You use the movement of the mouse to calculate the value of the angles.
So, if the first value you read from the mouse was that it was located at (30,50) and the next time you read the mouse, it is at (50, 40) then you’ll have a positive y rotation and a negative x rotation.(As you can see, the X component tells the y axis rotation, and the Y component tells the x axis rotation(some thinking about geometry will cleary make you understand why.)
Still, we don’t have a rotation value. Well for that, you need a mouse speed. So let’s say I use, for every 10 units move by the mouse, I have an angle of 10 degrees.
so (50,40) - (30,50) = (20, -10). This what gives us :
at -10 degree rotation around the x axis, and a +20 degrees around the y axis.
You can even had a user defined variable(like in games) to set the mouse speed to the liking of the users. You just multiply the value of the angle with that variable to have the new mouse speed.