Change of Basis Formula for Quadratic Form Matrices