See this post: How to properly use entity.setLocalEulerAngles?
TLDR, you can’t with getEulerAngles(). If you are working directly with euler angles, you have to keep track of the rotation values yourself.
If you need to calculate the value, you have to do that yourself via trigonometry and using the directional axis on the Entity.