Like any other DAW programs you can create or record some midi tracks patterns (rhythm, melodies and basslines) and then you saved them as .mid (midi) files.
Unfortunately, this is the easy part.
https://www.youtube.com/watch?v=CILJZLPSxWohttps://www.youtube.com/watch?v=Bq8b12gvkX4The second part is more complicated, especially if you want to use this midi as accompaniment style on your T5. There's something to do with this midi file before you enter it on your instrument: Make some style patterns, transpose melodies and basslines on a CMai key and, last but not least, you must create a CASM on each track of your style...
This a PITS job, but there's some tools available to use:
Jorgen gave us some useful (and freeware) programs like midi2style and CASM editor and when you'll be familiar with those programs then you can make anything you want.
http://www.jososoft.dk/yamaha/software/software.htmOn the other side, if you want a all in one solution, then you must look for another (but not freeware) program, like the StyleMagicYA.
http://www.midisoft.pl/On StyleMagic you can edit your midi file, define your style patterns, create a CASM, swap channels, transpose style, change instrument on every channel and the you can save your work as .sty format, ready to use on T5..
I hope that helps.