Critical behavior of commensurate-incommensurate phase transitions in two dimensions