First and most important: if you want to train a dog or change his behavior, you have to do it immediately during or a maximum of 3 seconds after he did something. If your dog chases a motorcycle and you leash him after you returned home, he has no chance at all to understand why he's being punished and learn from it.
Second: How does your dog perceive an encounter with a motorcycle? These are some assumptions about your behavior and an explanation how your dog understands them:
- You are walking through the woods, your dog is sniffing around, you are relaxed, everything is fine.
- You notice a motorcycle approaching. You know that your dog might misbehave, so you watch him. You dog thinks:
transient_loop heard the motorcycle and is now looking at me. They want that I take care of this intruder!
- You yell at your dog to stop chasing, but your dog thinks:
I started barking at the motorcycle and now transient_loop is barking, too. We work together to chase the thing away.
- You catch up with your dog after a while and punish him. Your dog thinks:
Sometimes when transient_loop comes to me they punish me. It's better if I run away when they approach, so they cannot punish me.
You see that yelling at your dog and punishing him after returning home doesn't work.
A very simple alternative is to not let your dog run without a leash. There are long leashes available that allow your dog to run and sniff araund, but you always have the control and he cannot run away.
The second solution requires regular training. You need to take some treats (or his favorite toy, whatever he likes more) on your walks and then you train "come here" with him. Just go on your usual walk and do your usual thing and at random times you call him back to you and give him a treat.
At first it's easier to train when he's not distracted. Give him the treat immediately (max. 3 seconds) after he came close enough to you to grab his collar. Repeat the training 5 - 10 times during every walk (even after your dog learned it.
Then, as soon as you notice a motorcycle approaching, call him back to you and give him a treat as you always do during your walks. Grab his collar to stop him from chasing and give him more treats, one after the other. He's supposed to learn that being calm and by your side is much better than chasing motorbikes, so you need to give him more treats than usual.
You cannot wait to call him to you until he starts chasing the motorbike. Almost all dogs have a hunting instinct and the fast moving vehicle triggers this instinct. It's better to stop his behavior before he even starts chasing.