Hierarchical reinforcement learning for efficient exploration and transfer