If the matrix A2 does not contain a non-zero element on the position, where A has zero, then is the relation transitive (and vice versa).
In a different wording: if there is a two-step path "ax-xc" between vertices a,c then the shortcut ac must belong to the relation. Othervise is the relation not transitive.
It is not necessary to have A2=A.
Example:
Let the relation be R={ab,ac,bc}. Here A2 and A are not equal, but R is transitive.