In situ visualization and nanophotonic control of hydrogen-driven nanoscale phase transformation dynamics