Training to play by ear starts with 2 of your senses: Feeling and obviously Hearing.
Most people underestimate their ability to Play By Ear. Practically ALL THE TIME, everybody would rate themselves very low in their scores until I show them their TRUE scores whenever I conduct a TALENT EVALUATION on them. It would be good to assess the strength of your ability in terms of the above and also your dexterity and memory ability. Once you know it, you will know FOR SURE what your chances are.
Once you can do that, the below applies:
Learning intervals have a part to play. However, personally, I feel that by the time you analyzed the intervals, the music would have gone far, far ahead in real time....unless you have already memorized the tune and are playing it back from what you have heard; or you are rewinding the tape or CD over and over again just to listen to the relevant parts.
For me, having taught 5000+ people to play by ear over the last 25 years, I prefer to use "active sensing" to find the right keys. Of course, it takes time and making a lot of mistakes initially to acquire that ability. However, once acquired, you tend to zoom to the right notes quite quickly or at the least, nearby. If you 'miss'; you just simply "bluff" your way to the right notes.
Learning the rudiments is great and that's what I did but I find that other than the rudiments, the rest are not really that helpful until you have gone through the experience first and then when you look back, then only you understand how it was applied. It's easier to understand that way. That's why I take the student through the experience first and then only tell them the theory behind it. Otherwise I would bore them to death. (This is also the reason thousands upon thousands of wannabes gave up music - theory first, practical later or never at all).
What I mean by "active sensing" is: Each and every note in the scale (doesn't matter what key) have a character. Like learning to recognize faces, you learn to recognize sound. As you hum the scale, LISTEN and FEEL the character of each SOUND. Taking Note 1 as the reference point, you will notice that Note 2 tends to sound SMALLER (More comfortable visualizing it as smaller than bigger); Note 3 seems to rise up to a level closer to Note 1; Note 4 is VERY STRONG - higher than Note 3; Note 5 drops down to a level close to Note 1; Note 6 rises up a little and Note 7 DROPS A LOT and than Note 8 goes back to a level like Note 1 except of higher pitch.
There are finer things inside each note (maybe you won't be able to describe them but you can feel them) that you will notice as you go through the range. As you go along trying to find melody notes, you will UNCONSCIOUSLY hit the right notes as you go along.
These variations of the 7 notes also are the building blocks for your expression. Singing or humming out the character of these notes adds to the expressiveness of your song if you sing them with awareness of the characteristics. For a simple start, try it out with Love Me Tender or Aura Lee and see if what I say is true or not.
These characteristics are also the building blocks of your chords. Notice that Chord 1 consist of 3 notes of Middlish strengths; Chord 4 consist of 1 very strong note and 2 Middlish notes and Chord V7 consist of 3 weaker notes and only 1 strong note that tends to want to push you to finish on Chord I? In that respect, these 3 chords creates 3 different expressions that are fundamental to almost any songs.
These strength and weakness are relative to each other in a scale. People will ask me: Based on this theory, won't the expression spiral upwards or downwards with no ending? It is a mystery I am not able to explain as yet. Somehow they seem to fit like a close fitting right with lots of components inside and end up in circular motion (instead of spiral).
Whatever it is; try to develop these awareness described above and see if that would help you.