Fine-grained Generalization Analysis of Structured Output Prediction