From the comments:
If you show me an alogrithm capable doing this, I am more than happy to automate it.
For a software approach I would try to use OpenPose, a deep-learning based human posture tracking stack.
They have pre-packaged builds so you don't need to recompile anything yourself. You just need to download the neural network model, put stuff in ...
If you have guides to align shoulders/lower edge and possibly the center of the t-shirt, you don't need to play with opacity to align on a model. I don't know PS, but with Gimp:
There is an ofn-preset-guides script to create custom guides with a single keystroke
There is an ofn-file-next script that does "Save & close current image, open next" that can ...
The "Free rotation" tool has an "automatic adjust" option.
You can use the "Rotate" tool in "corrective" mode, and tell it to display various patterns of lines that you align on things that should be vertical/horizontal.
In Gimp 2.10, you can also use the "Measure" tool and measure the angle of something that should be vertical/horizontal, ...
I'd recommend darktable for this: see the Crop and rotate module, which has a grid under the 'guides' option.
However, note that with darktable there's a potentially better way of doing what you need to do: you can rotate to a desired reference line by "drawing" that line on the photo. To quote the manual:
To use your mouse, right-click, hold it down and ...