Calculate Pitch (-90 to 90) from Euler Angles

I have some trouble converting euler angles to pitch angles for aviation that ranges from -90 (pointing to -Y) and 90 (pointing to +Y). Therefore if exceeding those bounds the final pitch should be substracted again. I have made a sketch to visualize what I want to achieve (grey angles):

149316-pitchfromrotation.png

I have this code for pitch, but it goes only from 0 to 90.

pitch = Vector3.Angle(new Vector3(transform.forward.x, 0, transform.forward.z), transform.forward );

Use SignedAngle.

To get the pitch angle all you need is this:

float pitch = Mathf.Asin(transform.forward.y) * Mathf.Rad2Deg;