As well as being useful for learning licks and solos, visualizing is good for all types of ear training.
You can also do many exercises without the guitar, maybe waiting for a bus or whenever you have some spare time to fill in. Just visualize the guitar fretboard in your mind. For example, you could carry a tuning fork with you and in any spare moments do this exercise.
Hit the tuning fork and get it to sound A440. From that note sing the minor pentatonic scale up and down. Sing " … One, flat three, four, five, flat seven, One etc … " Then check the tuning fork to see whether you are still in tune. As you sing, visualize the notes on the guitar fretboard. This works for all types of scales, arpeggios, and rhythms. Pretty soon you’ll find yourself inventing licks, rhythm parts and all sorts of things even without the guitar in your hands.