Align an array of vertices to vectors with python
The question is equivalent to say:


vert_array is a set of coordinates in world space
a coordinate system is given by its 3 vectors also in world space
how to convert vert_array so that it has in world space the coordinates it should have in this coordinate system


So, the point is to find how to do that.

To convert from 1 coordinate system A(X, Y, Z) to another B knowing X', Y', Z' of B in A, you can use a matrix like the following composed of 3 columns which are respectively the coordinates of X', Y' and Z'.

Once the matrix defined, as it allows to convert from A to B, we need to get the inverted matrix to have the result.

Here is an example in Python:

import bpy
from mathutils import Vector, Matrix

# Coordinates system: enter your own values there
x = Vector( (0.70711, -0.70711, 0 ) ) 
y = Vector( (0, 0, -1 ) )
z = Vector( (0.70711, 0.70711, 0 ) )

# The matrix to go from world to the coordinates system
# It is defined by rows
m = Matrix( ((x[0], y[0], z[0], 0 ), (x[1], y[1], z[1], 0 ), (x[2], y[2], z[2], 0 ), (0, 0, 0, 1 )) )
m.normalize() # mainly because values are approximated above

m_inv = m.inverted() # as we need to go from the coo system to world

objects =bpy.context.selected_objects #get some objects (or take your vector array)

for o in objects:
    o.location = m_inv * o.location #apply the transformation