The PROCESS is exactly the same. There's a lot of different skills one needs to be "able to play by ear". That means you gotta hear, you gotta be able to find what you hear on the neck, and you gotta be able to move your fingers to get to those notes, and you gotta do it all at the right time. That's a LOT of stuff to learn so there isn't a simple answer.
First, the hearing skills you use to figure out the melody to "Happy Birthday" or "Amazing Grace" are exactly the same as the ones you use to figure out "Whole Lotta Love" or "White Room". The difference is, with "Happy Birthday", you already KNOW how it sounds, so start there. Pick a note in the middle of the neck. D at the fifth fret is a good one. Now sing the first two notes, that's all, just the first two notes. LISTEN carefully to the sound of the second one in relation to the first one. It's only one of three directions. It's the same, it's higher, or it's lower. So there's the first distinction you need to make. If it's higher, try different notes until you find what sounds right. Now play the first two a few times to fix the mechanics in your memory. Then sing the third note, and do the same process.
Now, MalcomAmos' suggestions start to work for you. If you're used to playing and LISTENING to what you play when you play scales, your ear and hand have already learned some relationships that'll help you find those notes in the songs faster. But that's only if you're actively engaged in what you play. That means just learning the fingering for a scale or a chord arpeggio is worse than useless. You simply MUST have your ear working on it at the same time. So, whatever you're practicing, SING
* it, with the goal of hitting the note you want before you play it. You want your ear and brain to lead your fingers, not the other way 'round.
And, learning the basic chords will help a lot! The first bit of Jack Bruce's line on "Badge" outlines the Amin chord. "My Girl" is simply the fifth and root of the C chord. The basic boogie bass line is a dominant 7. So study arpeggios, again singing them as you go.
That covers the part of playing by ear that's related to finding the notes on the bass. And the more you physically play the bass the better your manual execution will be- AS LONG AS YOU USE GOOD technique. So pay attention to your hands and finding the most effective way to physically approach the instrument. Hint- the reason a lot of really good bassist look goofy is because they wear the bass higher where it's easier to play than lower where it looks cool

.
Then it's the part of hearing what's on the record. There's technology already mentioned that'll help with that. And your study of arpeggios and scales will help you guess where things are going when you can't quite hear it. Plus there's the very liberating point that it's not uncommon. Will Lee has talked about coming up with bass lines for old records that have the bass buried- where he has to create one because the one on that particular record is lost in the mix. But the more you do it, the better you get. It's a time thing. Here's one good tip I wish I'd taken to heart 30 years ago. SING the line. If you can sing the part, then your hand can eventually find it.
And the ultimate secret of execution is to be very slow. Take things at ridiculously slow tempi. If you can't execute a part smoothly and precisely at 60 BPM, there's no way you'll play smoothly at 160. Get your muscles used to doing things correctly and then you can increase the tempo.
It's a process, and it'll take time. Just keep plugging away with a plan and don't let frustration take over.
John
*And don't worry that you "can't sing". My own singing was once described as "imagine a duet with Yoko Ono and Linda McCartney". The point is what you hear in your head, and singing, however putrid it might be, allows you to fix that sound in your head. So do it.