Learning to Adapt the Parameters of Behavior Trees and Motion Generators (BTMGs) to Task Variations