The built-in demo songs are protected from being output over a MIDI connection, so there's no way to export them to MIDI files that can be played back on other models.
However, some models have only a few built-in demo songs, and the remaining demo songs are in the form of MIDI files that are either provided on a CD-ROM that comes with the keyboard, or that can be downloaded from Yamaha's web site.
It's possible that the person is using a demo song that was already available as a MIDI file. If that isn't the case, then I don't know how he might have accomplished this.