Generalizable chemical mechanism extraction from molecular dynamics simulations