Relative/Tune/Memorize

Get sheet music for a song. Note the key it is in so you will know which notes to finger. Note the starting note. From the starting note look at the intervals to the next note. It wil be easy to know when the next note is a next consecutive note. Also it will be easy for you to know if the sound is two notes up.
Make a mental note of the note spacings as you play the melody. There will be a jump more than the two notes away that you can easily recognize. Was the spacing a 3rd interval away ? ... the 4th interval?.... more? As you make mental notes of the distance of the jump you will start to hear the spacing and know how many intervals. Sing the lyric that is tied to that note as you play each interval.
Your subconscious will work for you as you learn the melodies of numerous songs. You will be surprised at how easy it is to learn melodies making note of the distances between intervals in a song melody.