Induction and Exploitation of Subgoal Automata for Reinforcement Learning