Well, it's late here, and I don't have a korg M50 kb
Basically, the value slider on your korg can be set to manipulate cut-off, resonance etc. while playing it.
So you just have to set up Sonar to record these controllers to midi channels, as well as the notes you are playing.
Sonar may record them automatically if you have the cables patched correctly, and the korg set to send midi cc's out.
Then, when you playback through midi out, to your korg (if set to receive midi cc's) you should hear them applied to the sound.
Perhaps someone else here with a korg will give you more specifics, but also please help yourself by reading about midi continuous controllers in your korg manual as much as you can.
EDIT, looks like Jeff has jumped in already !