LicoriceAllsorts
Donator
He remembered the truck ride with Zack talking about crashing with a girl in Midgar, and he probably pieced it together at some point that with how Aerith had been talking about him, he must have been talking about her. Add in that AC shows Cloud flashing back to a number of different scenes with Zack and it's fully possible that Cloud's remembered other memories with him too. Then toss in that CC Zack dies thinking of Aerith and was determined to get to Midgar for her and it's easy to imagine that he rambled about her to a headbobbing Cloud once or twice. Especially since the dying thought was for Cloud to say "hi" to her for him, implying he thought Cloud might know her if he saw her.
On the other hand, there's not much suggestion Tseng has had any communication with Cloud prior to Advent Children for Cloud to know from him. The Turks are busy with their thing and mostly staying in the background, Cloud and Tifa have their own worries. Tifa's line to Reno on the phone implies it's been a while since any contact occurred. I think it's more likely he figured it out on his own.
I don't think there's any solid reason to suppose that he ever figures it out. Of course we, the audience, read a certain significance into the fact that Zack and Aerith leave the church together at the end of ACC, because we know that they shared a bond which had nothing to do with Cloud, but for all Cloud knows, they are both there for him only and have no other reason to be in the same place together.