Good question!
First thing is that sub 40 is a big land mark for club runners for a reason. It is tough! I normally race at around a 36 min 10k but the 40 min 10 k in training last night still hurt like hell. Here are a few points on your Original Post:
Treadmill running is never as good as road running. There is no way I would do enough miles to do a 40 min 10k on treadmiles alone. You need to find a way to hit the streets or trails in the week. You May need to get a headtorch in the winter.
Your 3 x half marathons in a month seems like a lot. With all that racing (plus a couple of days taper) I wonder where the training fits in?
This might sound obvious but you need to run each race KM in sub 4 mins. If you do the opening k in 4.10 then you need to find 10 secs somewhere... which means running a k in 3.50... which is 38.20 speed... which will hurt.
For 10 k racing you need to start fast (see above) which means a big warm up. 20 mins is the absolute minimum. I run 40 mins. Jogging round the car park is not enough. I go out to the 2k mark to do some stretching and run and back.
For my own racing, I don't have much speed so I can pretty much double my 5 k time to work out my 10k time. The suggestion above to do some park run events is a good one.
You dont mention your total mileage, and this is probably the most important bit. It is hard to run sub 40 mins on less than 40 miles running a week. Of course everyone will have shortcuts and magic training sessions to do it on less than that, but without a coach /club / track it will be hard ot motivate yourself to do the hard sessions.
Good luck. It will be an amazing feeling when you crack it.