Learning Generative Models using Transformations