Don't use Euler angles for this. Instead, check the object's local 'up' vector to see how 'upright' it is. (An easy way to do this would be to compare the local up vector's 'y' value - assuming y is up - to some threshold value, e.g. .7. If you want to express the threshold in terms of an angle, you can compute the threshold for the y value from that angle using trig.)