Wrong .rotation.eulerAngles.x output

I can’t seem to read rotation angles. I have tried lots of things and this line of code seemed most promising to me but doesn’t give right output.

It reports angles of:
360 to 270 in the first quadrant.
270 to 360 in the second quadrant.
0 to 90 in the third quadrant.
90 to 0 in the fourth quadrant.

I need these rotations to implement an inertial dampener like in Elite Dangerous to my spaceship.

Relevant code:
void fixedupdate()
{
var rot = tr.rotation.eulerAngles;
var deltaXRotation = rot.x - lastXRotation;
var lastXRotation = tr.rotation.eulerAngles.x;
}

EulerAngles do are not a unique representation of an orientation in space. Unity stores the rotation of objects as Quaternions. The conversion from Quaternion to eulerAngles is not unique. For example the euler angles rotation (0, 0, 0) is the same as (180, 180, 180) or (-180, 180, -180). Eulerangles suffer from gimbal lock at a rotation of (90,0,0) or (-90,0,0) where you loose one degree of freedom. Quaternions do not have this problem. You should base all your calculations on direction vectors.

If you want to know the current rotation speed around the objects local x axis you should store either the objects up or forward vector. The next frame you can project the saved vector onto the y-z plane and calculate the angle between the two vectors (the projected up and the current up vector) by using Vector3.SignedAngle.

However if you want inertial damping you can just damp the rigidbodies angularVelocity by multiplying it with a damping multiplier. However you can also just use the angular drag. It highly depends on your exact desired behaviour.