I have a terrible time remembering songs by rote memorization, but as long as I can remember where it starts, goes and ends I can probably pick it back up, just by remembering the chord the song starts on. It's because I've improvised a ton in different keys and I know my pallet of notes to choose from. I'm familiar with what chord colorations are available and I know how melodies tend to move. Do I hit wrong notes? Sometimes, but I guess if I know they're wrong and correct them I'm still playing by ear, but I'm also playing a little bit by theory too, the theory kinda shrinks the constraints of playing by ear.
If I see a chord progression, let's say G-C-D, I don't remember it that way. I remember it as a I-IV-V progression in the key of G. It helps.