A Unified Generalization Analysis of Re-Weighting and Logit-Adjustment for Imbalanced Learning