Given the difficulty and lengthy process of reloading a gunpowder firearm, it would seem like having proficiency in traditional fighting techniques would remain a crucial part of military training.
Did the rise of gunpowder shift the traditional battle formation so drastically that men were no longer expected to engage in hand-to-hand combat? What about when armies campaigned in regions against opposition which had not acquired gunpowder weaponry?
In Short: How much training time was put toward operating a firearm?
This is a long, long period of history you're asking about here. I think it's best separated into before and after the development of the socket bayonet (the late 17th century). I'm most familiar with warfare before that development, so I'll focus my comments there - specifically on the 15th and 16th centuries.
Arquebusiers and musketeers were largely expected to stay out of hand-to-hand combat, as archers before them had done. Melee combat was the responsibility of specialized melee troops who protected the shot (the term for ranged infantry) against enemy cavalry and infantry. It would be very rare in this period for shot to operate without the cover of friendly melee troops, namely pikemen (thus the term "pike and shot"), under whose protection they could retreat in the event of an enemy advance.
So gunpowder troops would receive almost all their training in operating firearms and interoperating with pikemen (learning to quickly advance and retreat from the cover of the pikemen), and would leave melee combat to the specialists. That's not to say that they wouldn't carry swords, or try to use them if forced to do it, but much like archers before them they were light infantry and ill-suited to fighting cavalry or heavy infantry.
An important thing to remember is that the place gunpowder troops occupied was quite similar to the place skirmishers had occupied for centuries. It wasn't as if the entire army suddenly used gunpowder weapons, and their function continued to be supporting pikemen as they clashed with the enemy's pikemen.
By the rise of gunpowder, I assume you mean in the 16th and 17th centuries?
When I looked at Revolutionary War battle statistics, I was surprised to see what a large proportion of casualties and KIAs were caused by bayonets.
The best analogy I can think of is how in phalanx warfare you would mostly have a contest of pushing and maneuvering. A few guys on the front lines would get stabbed, but it wasn't usually until one side outmaneuvered the other and the formations started to break and one side retreated that you got widespread death.
That seems to fit the pattern of Revolutionary battles in some instances- all of the shooting and maneuvering was vital to gain an upper hand, but most of the killing happened when you broke the enemy's formation and charge in with your bayonets.