How Does Independence Help Generalization? Sample Complexity of ERM on Product Distributions