Mechanical rotation at low Reynolds number via reinforcement learning