How to record audio from an application/audio device?
VLC has an option for listening to network streams, so if VLC is compatible with the stream that you want to listen to it also offers an option for saving that stream to your HD. In the dialog box that lets you enter the stream URL there is a drop down menu by the OPEN button that lets you save the stream.

Of course this does depend on if VLC will open the specific stream you want it to. Many streaming services use special players and DRM to prevent such things. Failing the VLC method Tetsujin has an excellent recommendation in Audio Hijack as it doesn't care about any of that and just records all the audio passing through your Mac.