Phase transition mechanism of the two dimensional antiferroelectric squaric acid