Euler angles and extrude direction

hello.
I have a direction vector ,long this I’m extrude a section, the section is a list of 2d points.
For calculate the extrusion direction i have to multiplicate a non trasformed direction for a trasformation matrix.
This matrix have the trasformation in x,y and z(like euler angles).
I must calculate the rotation angle around the extrude direction,
I have a matrix class that returns the euler angles from a matrix(matrix.ExtractEulerXYZ(x,y,z)).
The problem is that I can have a direction vector that have a rotation in x or y or z , how i can select the correct angle from x,y or z from the extrude direction?
Thanks.