Congruences of a square matrix and its transpose