The Doctor could communicate with the flesh, it read him and I think the Gangers could sense that there was another Doc now Flesh, even if they didn't know which one... So tbh the idea that he knew outrightly Amy was Flesh isn't really a leap...
If we add in the timey wimey and time looping back and the future already being the past and the possiblity that the Doc could sense it before going... Perhaps cause of a TARDIS scan, then the knowledge Amy was flesh is pretty easy for him to grasp