Long time ago, about 1978 I did this. I had some thick aluminium strips curved on one end. The strips fitted underneath a top box with shaped parts sticking out. I took both wheels off my time trial bike, fitted a chain keeper, and mounted the frame with the seat tube horizontal in the aluminium strips. A pair of toe straps, one over each strip, plus an elastic cord from the head tube over the top box and all was secure. The wheels were tied to the other side of the framework supporting the top box. That worked fine on machines of the time, but on modern ones with higher level or sharply raked exhausts it might be more difficult.
Somebody else at the a time had a flat plate where my top box was, and had a upright stay . The frames rear ends fitted to an old hub or axle and the frame was tied vertically to the upright stay. Wheels were tied to fittings along side the frame - like those you see in TdeF neutral support motorcycles..
My arrangement looked ok, his (in my opinion) looked odd because the set up was so tall. I do not see that either would be illegal because they loads are fully secure and o not add greatly to length or width of the loaded motor cycle. I cannot show a photo because I do not "do" photo hosting.