It's different for everybody, and it's just pretty much whatever works for you. I prefer to learn which chords are there in the song, then how the chords are put together and how they flow, and then learn the lead afterward. You can't play the lead correctly, even if you hear it correctly, unless you know what key you're in.