Representing Skill Demonstrations for Adaptation and Transfer