You do that, you need to thing about sprocket alignment too.

Usual way round that is to narrow the axle on one side and offset the diff housing so it lines up with the motor sprocket.

Ideal choice is an axle with a bolt on crown wheel, that way you can unbolt it and machine a chainwheel to fit in the original fixings.

A chainwheel is essentially a "blank" sprocket with teeth for the chain, but no mounting holes. There's obviously limitations as to what size sprocket you can run, it has to fit in the housing, and it has to be bigger than the actual diff.

You need to dump the pinion, and the diff's gears really ought to be encased in something oil tight so they're running in oil.

Slightly messier but getting round a few of those limitations is to run a jack shaft driven off the motor and drive the modified axle from that. This means you don't haver to noarrow the axle to line the sprockets up and you can fart around with the gearing by using different size sprockets on the jack shaft if what you can fit in the axle isn't working out.

But, it's probably easier to use a Yamaha middle box. The XS750/850/1100s all have a removable bevel box on the motor. You can convert the motor input shaft to a sprocket, mount it in the frame and chain drive it from your existing motor sprocket. This puts a drive flange bewhind the motor, pointing at the axle. Four bolt Yam's seem to use the same flange as some Toyota's, so it's relatively straight forward to build, or have built, a hybrid drive shaft and run the whole thing as a shaft drive.

Those are usually referred to as "Yamaha Middle Boxes", and bit of a search on Google ought to turn up something.