Pack it really well!
I’ve always used a bag to transport my road bike as it was cheaper to buy. There are pros and cons of each.
Boxes are likely to be more sturdy but are expensive and harder to get mtbs in. You can hire them though. A few shops near me do it.
If you decide on a bag my tips would be to try and get some really thick card (like a box for a bike frame) to add some structure. A roll mat can also work. I then cover the frame in pipe lagging and protect, remove, immobilise fragile bits. Things like mechs, shifters, brakes.
Loads of guides out there.
Remember you need to get it home so don’t destroy the packaging.