From data science to physical insight: systematically identifying the collective variables describing phase transformations in flexible materials