I have two 9-DOF IMU BNO-055 sensors. I need to get the angles between these sensors (the first sensor is in a stable position, the second moves and changes its position). An example of such an angle, I presented in the image below.
As pointed out an an orientation or rotation in 3D is not an angle. Its a unit-quarternion(*) - you simply divide quarternions to give the relative orientation between them, just like multiplying quarternions to compose orientation changes (3D rotation).
(*) You can represent also as a DCM, but that's much clumsier. Unit quaternions have a scaler part and a vector part and the vector part directly provides a vector along the axis of 3D rotation. You cannot dodge the maths for 3D rotations alas, intuition is usually wrong. https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
Note that after doing the division you can extract the axis of rotation and amount of rotation (which may be what you want) from the resultant quaternion. You are multiplying quaternions though.