The exchange scattering at magnetic adsorbates on superconductors gives rise to Yu-Shiba-Rusinov (YSR) bound states. Depending on the strength of the exchange coupling, the magnetic moment perturbs the Cooper pair condensate only weakly, resulting in a free-spin ground state, or binds a quasiparticle in its vicinity, leading to a (partially) screened spin state. Here, we use the flexibility of Fe-porphin (FeP) molecules adsorbed on a Pb(111) surface to reversibly and continuously tune between these distinct ground states. We find that the FeP moment is screened in the pristine adsorption state. Approaching the tip of a scanning tunneling microscope, we exert a sufficiently strong attractive force to tune the molecule through the quantum phase transition into the free-spin state. We ascertain and characterize the transition by investigating the transport processes as function of tip-molecule distance, exciting the YSR states by single-electron tunneling as well as (multiple) Andreev reflections.