Welcome to the forum.
Yes you can. Just record/write your MIDI track using the CP50 or mouse.
Plug the audio output of the Yamaha into your sound card/interface's input.
Set the MIDI track's output to the MIDI device you're using.
Set an audio track's input to your sound card/interface.
Hit the R in the audio track. Hit Play. Set the recording level (this is done with your sound card's mixer; Cakewalk can't control the input).
Once the level is set, rewind and hit the record buttion in the transport box. The MIDI track will play through the CP50 and the keyboard's audio output will be recorded in the audio track.