Differential privacy and generalization: Sharper bounds with applications