Charge compressibility and quantum magnetic phase transition in MoS2