You need to connect the audio out of your hardware synth to the input's of your sound card, (left to left right to right)
Then in SONAR insert a stereo audio track(default) with the input set to the inputs of your sound card that you have used from your synth.
As you have recorded the midi, you now need to arm the audio track, i.e. set it to record. Press W to rewind to the beginning, press R to record.
Make sure that the levels in the meters do not go much higher than -10dB, if they do press the space bar to stop the transport. Turn down the output of your synth until this level is archived. Do the recording again.
When it reaches the end of the midi and all the sound has died away press the space bar to stop recording. Disarm the Audio track to stop accidentally recording over the top of it.
You now have your audio recorded. You then need to export the Audio to a wave file.
File > Audio > Export. set the type to wave. Set the bit depth to 24 (this will give you the best resolution), type a name in the title box. Select a directory to export to. Hit OK. Now you need to get yourself a wave to MP3 conversion program.