A theory of phase transitions in quasi-one-dimensional electrons