Perhaps you can try Upright automatic perspective correction:
The Upright feature provides four modes of automatic perspective correction...:
Auto: Balanced level, aspect ratio, and perspective corrections.
Level: Perspective corrections are weighted toward horizontal details.
Vertical: Perspective corrections are weighted toward vertical details and level corrections.
Full: Combination of full Level, Vertical, and Auto perspective corrections.
You can sync the Upright Mode (not the Upright Transforms) across photos, it will then correct each image based on the content of that specific image.
Best to read the above linked manual page to understand how this Upright functionality can be used.