Correct Per-Vertex Tangent & Binormals

What’s the correct way to do per-vertex tangent generation?

I’ve seen a few people do it like this:
C1 = cross( N, {0.0, 0.0, 1.0} )
C2 = cross( N, {0.0, 1.0, 0.0} )

T = (||C1|| > ||C2||) ? C1 : C2
B = cross(N, T)
Where N is a vertex normal

I’ve also seen it done like this:
E2-1 = V2 - V1
E3-1 = V3 - V1

T = E2-1.xyz / E3-1.u
B = cross(N, T)
Where V is a vertex containing a position (XYZ) and a correct texture mapping coordinate (UV)

Also, if the normal is transformed by an inverse transpose of the object matrix, what would the tangents be transformed by?

Thanks in advance!