A Continuous Optimization Framework for Hybrid System Identification