[2405.02670] From Generalization Analysis to Optimization Designs for State Space Models