On Certified Generalization in Structured Prediction