Thermodynamic signature of a magnetic-field-driven phase transition within the superconducting state of an underdoped cuprate