Ground state shape phase transitions in nuclei: Thermodynamic analogy and finite N effects