Generalization Error Bounds for Time Series