Hey irure.

What you did is correct where X'' = ABX will compose two rotations and return the vector of those composed transformations.

Just make sure that you don't have gimbal lock and do the compositions in the right order and then multiply the matrices to get the final transformation matrix which is used to transform your original vector.