How do you find true upper rotation?

Here’s my problem I need to find a specific rotation value of an object
it’s like up and down rotating about the x axis in local space
but i only care about the value in relation to world space

I couldnt describe this well so i made a little pic
the solid arrow is the forward vector
and the dotted arc is the rotation value I want to track
so even if the object rotates with the other solid arrow curving around the cube
or even rotates in the other access
how do you find the rotation of the dotted line in the same position as drawn

sorry I’ve been plagued with this question for months
and as soon as i give up and ask the community i figured it out

basically i find the angle between the forward vector and a true up y axis
which i will get by saving the original rotation data from when it spawns