YES, you can.
Here is a detailed description of how you do that:
1) Install the free BlackHole Audio Driver - it is available on github.
This adds new audio input and output options that will be available in System Preferences->Sound and in menu bar.
The purpose of this is to be able to pipe the audio output from one application to the audio input of another - exactly what you need.

This alone would let you record: just set the audio output to BlackHole 2ch, and in the recording application choose BlackHole 2ch as the input.
But if you did just that, you would not be able to listen to the audio while recording.
To fix that, we need an extra step:
2) Open Audio MIDI Setup, and create a new "Multi Output Device". In this device, include BlackHole 2ch, and your headphones, or speakers.
3) Choose your new Multi Output device as output; choose BlackHole 2ch as the audio input, and record.
The audio plays through BlackHole from the source to the recording, and you can monitor through the speakers or headphones.
NOTE: when the multi-output device is selected, you can't change the volume of the speakers, so adjust it in advance to a comfortable level, before changing the output.