More than likely the cab mount, or frame mount under the bushing broke. You can see how the bushing is at an angle in your picture. The metal probably rusted away under the mount. Moisture can collect and the metal *underneath* the bushing (you can't see under there) can rust over time.
If that's the case, what i would do is get some PB Blaster and get the straw in where you think the cab support bolt threads are ...and spray them a few times over a few days. Then try to remove the rear two cab mount bolts, and loosen the front cab bolts several turns. Hopefully you can.
Then lift the cab with a floor jack under each side of the cab's rockers (or wherever you can get a solid purchase), and raise the back off the cab off it's mounts an inch or so. Remove the rubber bushings and see how much metal's left. Look up and see if the alignment is off. If not, then it's probably the box. But at first look, it seems the cab is off. If the frame mount is rusted, cut new metal and weld in there as needed.
If it's the box, then that's another issue. The box bolts which go into the lateral supports often rust apart where the bolts connect. There'd you'd probably want to remove the box and fix it, or replace with a rust-free box.
Those one-piece frame box/cab mount brackets rust bad too. Check yours. You won't find an obs truck in our salty area where that bracket isn't all rusted to pieces.
But I suspect by looking at your pictures, it's the area beneath the rubber cab bushings.