Here's how to get past it:
1. Interact with the tree. Talk to the moving tree, and it will tell you it's blocking the path.
2. Find the switch. Look around the area. There's a switch on the ground near the tree. It's often hidden by tall grass, so pay attention.
3. Press the switch. Press the switch and the tree will move aside, opening up the path to Goldenrod City.
Let me know if you need help finding the switch!