1. Hook up MIDI OUT on the keyboard with the MIDI IN plug that goes into your computer. Now hook up MIDI IN from the computer with MIDI OUT on the keyboard.
2. Have a program that can handle MIDI instructions being fed into it via an external MIDI device (in this case, your keyboard). One suggestion is MODPlug Tracker, though that is very laggy and annoying and I'm happy as hell to have Cubase instead (and legal too!

)
3. Set up the MIDI Devices in your program. You best look up an online manual for your software if you don't know how to do this.
4. Hit Record or whatever your program needs you to hit in order to start recording.
5. Play away on the keyboard.
6. Your sounds have been recorded.
7. Hit Stop.
8. You can now play back your MIDI recording through your keyboard (if supported).
9. Save as -> MIDI
10. TADA!
Remember MIDI isn't actual sounds. It's
instructions for sounds. For example, if I told my computer to play a MIDI file, it wouldn't be able to do that, because it doesn't know what to do with it. However, if I tell my computer to use my keyboard to play a MIDI file, it would feed the MIDI data into the keyboard, which would interpret the MIDI data as signals to play a certain melody. The result: music.
Good luck and have fun!