In your forward kinematics transformation matrix (4x4, incl. also translation, of just 3x3) the orientation of the end-effector is expressed relative to the base (or world) coordinate system.
SteveO described very well how to obtain the 3x3 rotation matrix, similarly you can obtain also the 4x4 transformation matrix
If you have the matrix you have to choose how do you want to express the coordinates. Commonly in robotics euler angles are used, with successive rotations about the axes of a coordinate system. After choosing the Euler angles, you also have to choose which is the succession of the rotation. In robotics in many cases the rotations are successive (intrinsic) rotations.
After choosing hwo do you want to express the orientation you can build up the orientation matrix from your rotations(e.g. X-Y-Z, then you multiply $R_{TCP} = R(\phi_x) * R(\phi_y) * R(\phi_z) $).
The orientation of your TCP expressed in function of your joints is $R_{joints}=R_{joints}(q1, q2, q3)$ or $^3_0R$ in the notation used by SteveO. Both of the matrices express the same orientation but in a different way, so $R_{TCP}=R_{joints}$ the joint angles are known in inverseforward kinematics, so you can calculate the orientation angles. Please note that if you are using Matlab the dcm2angle()
function does exactly this.