If it was me, and I'm not recommending you do this, but think about the principles involved and it may help you devise a plan for yourself....
I'd first measure the distance between the two side walls at the top where the ceiling joists meet the walls to get the width measurement that you want to achieve between the walls at the bottom.
Then I'd put cables with turnbuckles between the sidewalls at the bottom of the walls. Don't know how many it would take. But better to use more to get an even pull than fewer and risk cracking. You might be able to work from back to front, also, slowly pulling the sides closer like a zipper.
Then I'd tighten the turnbuckles a couple turns every few days to pull the bottoms of the walls towards each other until they are the same measurement as you got when you measured the distance between the walls at the top. This could take days or longer, but I'd go slow. Wouldn't want to crack the wall studs or bottom sill plate, etc... Heck, it might not work at all as it took years to get bent. So pay attention to cracking and things like that. May require replacement of studs, removal of cross bracing, etc... which could lead to building collapse. You have to make sure the sill isn't fastened to the cribbing before you start tightening. Don't know if you can to just unfasten one wall from the cribbing and leave the other fastened to the cribbing or not. Probably depends how bad the walls are out of kilter. But you get the idea that you want to end up with two parallel walls top and bottom. Then fasten the sill plates back to the cribbing. And finally put several temporary braces across the bottom between the walls to keep the distances from changing during the next step.
So once the walls are parallel to each other, you have to make them at 90 degree angles to the ceiling joists.
This would require cables from the top of one corner of a wall where it meets the ceiling, down to the bottom corner of the opposite wall. You'd put the cables high on the wall that's leaning out and low on the wall that's leaning in. Again, don't know how many cables it would take. But you get the idea. Start tightening the turnbuckles a few turns at a time. It should bring the building back towards square. Once it's square, put in triangular gussets between the side walls and ceiling joists to keep it square.
Here's a link to a video that does something similar but for the leaning front-back angle. Same principle, just a smaller building.