Quantifying Demonstration Quality for Robot Learning and Generalization