If you can figure out what the coordinates are of your arm pads on your tri bike, assuming you want to replicate that fit, it’s pretty simple to figure out if the P5x will work for you or not.
What Jonathan said is correct, but cutting through the red tape - that large is gonna be way too big for you. While pad/stack and reach don’t always correlate perfect to height and inseam, I’m 3 inches taller than you with a slightly longer inseam and I was solidly on a medium p5x
Height and inseam do not mean you can’t fit on it. You need to ask yourself, is your current fit what you want to replicate? If not, get a fit on a size cycle from a fitter you trust or that has good reviews to get your preferred numbers.
I am 5’10" with a 31" inseam and ride a large PX. The medium would have had me sitting too far behind the bottom bracket or I would have been at max reach. I wanted to be in the middle on reach so a large it was. You have your own story as does everyone else.
You definitely need to work out your pad X/y from your current bike. Easily done with a straight wall and tape measure.
The PX bikes have loads of adjustment so a large could work fit wise depending on your position. I’m 5’10 and have a large p3x, no way I would have wanted a medium, but then I ride quite steep and long.
Take your X/y and ask Eric on the Cervelo fit thread.
per cervelo’s height recommendation i should ride a M in my P3X, however i ride a L and i BARELY fit it with my reach. my fitter would rather have seen me get an XL bike, which blows my mind.