I don't know how you can do it with SoundForge, but you can certainly do it with Audacity. I think SolusLunes gave a pretty clear explanation of how to do it for Windows XP and Vista:
For Windows XP, all you have to do is:
1. Start Audacity.
2. Select the drop down menu near the microphone level slider.
3. Select "Stereo Mix" (or something that sounds similar.)
4. Hit the record button.
5. Play whatever audio you want to record.
6. Hit file, export as mp3, and you're done.
- - - - - -
For Windows Vista, it's a bit more maddening.
First, go to Control Panel- Sound.
Next, select the recording tab.
You'll see a menu of all the recording devices on your computer. Stereo mix is mysteriously missing.
Right click on that menu, and select both "Show Disabled Devices" and "Show Disconnected Devices."
Enable the stereo mix, make it your primary recording device.
Open Audacity, hit the record button. Proceed as planned.
Don't forget to get the LAME MP3 encoder, if you don't have it already.