As Gary/
@happyrat1 says, it depends on the capabilities of the keyboards.
For example, the entry level PSR-E keyboards that I have cannot do this; their built-in song recorder can record what I play on them-- with certain limitations, such as the inability to record the left-hand part at the same time as the two right-hand parts-- but it cannot record any MIDI data being received from an external source.
But the higher-level PSR-S keyboards have settings that let you assign one or more incoming MIDI channels to one or more parts on the keyboard, which lets you record the incoming MIDI data.
If you want the most control over what gets recorded, as well as the most options for editing, your best choice (in my humble opinion) is always going to be to use a DAW. That would let you record both of your keyboards-- either all at once or one by one-- arrange the MIDI tracks as desired, and export the final result [edit: to a MIDI song file using a specified configuration of channels].
By the way, I just saw your additional posts. I believe you should be able to send the PSR-EW400's MIDI output to the PSR-S750, and set up the PSR-S750's MIDI Receive settings such that you can record the data coming from the PSR-EW400. The PSR-EW400 doesn't let you pick which channels you want to transmit on-- Main will be on channel 1, Dual will be on channel 2, and Split will be on channel 3-- but with the MIDI Receive settings on the PSR-S750 you should be able to assign specific incoming MIDI channels to specific parts on the keyboard.