Induction of Subgoal Automata for Reinforcement Learning