Data-driven enhanced sampling of mechanistic pathways