Since I am by any measure not an athlete, I aim to just get up the next hill. After many years of riding upright bikes with the intent of staying in the saddle I have transferred to riding a recumbent where there is no choice. I don't know about legs vs breathing but I find that if I heat up too much that becomes a decisive factor for me. Therefore, low gears, moderate cadence have been my companions. It was always a point of honour to somehow get up hills without walking. Nowadays I look at it like this.
Everybody has a certain number of shots in their magazine. The stronger and fitter (and probably younger, too) that you are, the more shots you will have. So if you have a long hilly route you have to pace yourself or you will run out of ammo. I can tolerate a certain number of climbs but after a certain point it becomes much harder to get up them. On reflection it's the legs, definitely the legs. I've even considered the wisdom of stopping to rest on some of the early hills, or even walking part way up them, to conserve resources for later. When I was younger some part of my inner self would scream, "Heresy!" and start looking for a match to light the bonfire, at such ideas.
The ideal is to arrive at your destination with some to spare, in case you come across some monster climb that you hadn't bargained for just before you get there.
But then, I don't take part in competitions. I ride to please myself, and the pleasure (and the pain) is all mine.