How should TransformDirection be used?

How should TransformDirection be used? What does it do exactly?

TransformDirection() transforms a vector (as opposed to a point) from local space to world space. A common example of use is this:

forward = transform.TransformDirection(Vector3.forward);

Which computes the world-space z axis for an object. (Note that transform.forward is a shortcut for the above.)