Thermodynamic considerations on the formation and stability of metallic glasses