Learning Dynamic Mechanisms in Unknown Environments: A Reinforcement Learning Approach