When my son was young, I kinda had the same problem.
He went near the bike, and I told him... stay away from the bike, it will hurt you.
Wasnt long before he tried it again. This time, three smacks on his ass and being told again very sternly, STAY AWAY FROM THE BIKE, IT WILL HURT YOU.
Never happened a third time.