How to convert Eulers angles to Pitch-Yaw-Bank?
Well... lets start with the obvious: That takes a whole lot of math. If you already know linear algebra, you will now get bored.
Next, like Pitch-Yaw-Roll (PYR), Euler angles have singularities, in which you need conventions for having at least a workable attitude, because your component rotation axes become parallel (like gimbal lock).
The whole problem is described mathematically as two matrixes: One for PYR and one for Euler (XYZ). every column in such a matrix describes the base unit vectors of your local coordinate system: The first column is the X axis of your spacecraft (1,0,0) after being projected into the G-body relative coordinate system of Orbiter. Every matrix is 3x3 large, and every "cell" in the matrix contains a formula that calculates a number from the angles (PYR or XYZ).
And the resulting numbers in every cell in the PYR matrix is equal to every cell in the XYZ matrix (despite having different formulas).
So, you have 9 equations, and six variables (PYR angles and Euler angles)... now you just need to pick those equations, that are easiest to solve for your direction.
Now, since I am very lazy, I will just look for a link where the formulas have already been solved.