Given a certain coordinate frame, I can compute a new one by applying a set of rotations in a given order (what I call Euler $Z-Y-X$). So I yaw, then pitch then roll.
Now imagine that I want to do exactly the opposite: given two coordinate frames (same origin to simplify), how do I find out roll, pitch and yaw angles that were used to transform from one to the other?