In the U.S., most police officers are trained to assist in the birth of a child on scene and incidents of pulling over a worried new parents who are speeding to a hospital (in addition to having the ability to contact dispatch and have EMS sent out to the scene). It's not an uncommon occurence on American News for a story about a heroic cop who was able to assist in a pregnant woman's child on scene of a car wreck or traffic stop.
Additionally, issuing tickets is at the officer's discretion and most cops are people and understand that a traffic ticket is not what is needed in the matter. They don't have to cite you for anything on scene. I can't find any confirmation at the moment, but I have vague recollection of some cops in said situations even providing emergency escort to the hospital (especially if new Dad is so nervous he got himself lost or turned around). In the U.S., on scene officer instructions trump road signs and lights (if a traffic cop waves you through a red light at a busy intersection, you are not legally running a red light, even if the camera shows otherwise). These days, the tickets for speeding while trying to get to the hospital because of medical emergency will likely be by speed camera.
If for any reason, you do not feel safe to stop on the side of the road when the cops light you up, turn on your hazard lights and reduce speed to the speed limit or lower. This will signal to the cop that you are not comfortable with stopping at the present location (and you do not need to defend the reason, but common reasons are the highway speed is too fast, there are not safe places to stop, the road is not well lit or you want to stop in a place where you are not alone with the cop... or worse an imposter cop...) but that you will comply with the officer (cops actually recommend this if you are being pulled over by an unmarked cop car, as it's not illegal to own sirens in the U.S. and some imposter cops will typically use them to help give the illusion to their victims... and real cops don't want to give up unmarked cars for highway patrol... they know that on highways, they tend to accumulate a lot of slow traffic immediately behind them for a reason). If you are not far from the Hospital (less than 10 minutes at best probable speed) proceed to the hospital (in the U.S. most highways have signage denoting an exit with a nearby hospital (a white H on a blue field) and if the cop sees you heading in that direction, it's not a hard guess to make. You should turn into the Emergency entrance and proceed to the closest entrance to the building. If you are not close, look for a brightly lit parking lot (if at night) at a Chain Pharmacy, Supermarket, Gas Station, or Fast Food Restaurant (You want to identify likely 24/7 locations, as this means there is staff (especially late at night, and usually graveyard-shift staff are reliable), and likely some basic supplies that can assist. In the U.S. supermarkets aren't as reliably open 24/7 as the other options, but in many cases they are close to the pharmacy.). These will usually be right off the exit. Additionally, look for a fire house or station or even a police station or barracks (In the U.S. Fire services typically have an EMS on hand, both are usually grouped together and the officer following you is going to be much more relaxed (if you were gonna lead a cop to a trap to kill him, it's not going to be right in front of another police station and fire fighters tend to be close enough for a nervous cop to feel safe). No matter where you stop, keep in mind as difficult as the situation is for you, you at least know that you're in medical distress. The cop knows nothing about you. To the best of your ability, comply with the officer's instructions, but let him know ASAP that you're in medical distress and the extent of your symptoms.
All of this is more De Facto than De Jure, so if you are ticketed for such an offense, you will be responsible for paying the fine or appearing in court (which you probably should do as my experience is that most traffic court judges will at the very least reduce the fine or points to the license for less pressing reasons than this.). Tactically it's in your best interest to argue a ticket in such a way... and it's also tactically to your advantage to try and bring the little bundle of joy in as well (try and bring a friend you can trust with removing the brat if he/she gets too fussy while waiting for your specific case... the judges may love babies, but they hate any interruptions of their court.). In either case, bring records of your hospital stay (including admittance) and birth certificate as further evidence that you went to the hospital because of the reason you said you were.