You do not yaw around your ship's relative Z-axis. Instead, you yaw around an axis 45 degrees back from the Z-axis. To be sure of this, use one of the side views, you will see that the stars move exactly diagonally at a 45 degree angle when you turn. It should be trivial to implement in the physics with this in mind, instead of thinking of what roll to apply.
In XWA, some player ships DO yaw around the Z-axis (all the Corellian transport ships) so ideally this should be configurable on a per-ship basis (perhaps a property for yaw offset angle)
I'm guessing AI ships have no yaw offset in order to make pathing easier to calculate.
AI ships have all sorts of tricks that the player cannot do.
For example, they all can strafe up, down, left and right without changing their bearing at all. Not only they do this extensively to stay in formation, or to perform docking operations. When performing attack runs against capital ships, the AI craft keeps strafing at random directions all the time to avoid the incoming laser fire. You can see this when you are hunting down TIE Bombers, for example, while they are doing a torpedo run on a cruiser or something. Also, it is easy to see on B-Wings during the Capture Frigate Priam mission. They all do this wobbly movement that at the beginning I thought it was caused by floating point loss of precision.
There is many tweaks to the AI like this.
About the yawing, let say that the X, Y, Z axes match the right, up, forward directions from the pilot's perspective. If yawing is performed around an axis that is 45 degrees tilted back from the Y axis, wouldn't that be equivalent to rotating around both the Y axis and the Z axis at the same time? I am not so good at this rotation math things with quaternions, so maybe I need to ask a mathematician friend of mine.