Thermodynamics of "breathing" of metal-organic frameworks: free energy model for adsorption induced transitions