Great question!
It’s a bit open to interpretation. If you define “melody” as the most prominent tune at any given moment, then a bass solo certainly counts. Other people might say that a solo is improvised whereas a melody is a fixed part of a song.
Fortunately for the sake of ear training these distinctions don’t matter! You should be doing melody ear training. When it comes to playing by ear I would categorise basslines and bass solos as particular types of melody, and all the same skills you use for playing melodies by ear will also help you play a bassline or solo. There are some more specific aspects to each (for example you can use chord progressions ear training to help you play basslines which follow the chord roots) but essentially you’ll want to develop the same relative pitch skills as anybody who wants to play melodies by ear.
If you haven’t already, I’d suggest checking out the Bass Ear Training How-To and this FAQ which both cover this subject in more detail.
Does that help?