How and where would they be transported, what would happen to them?
There's really no specific, but, they could be transported to field hospitals, which could be anything from a few tents, to a house that was cleared out and made into a hospital.
Usually the transport would vary by injury, if you could, you walked, if you couldn't and it was available, you could be loaded into the back of a cart.
What would happen, would greatly vary by what was WRONG with you. If shot, odds are the first thing to be done was to remove the boolit. Then trying to fight infection. Medicine wasn't TOO advanced, but, there was some. However, 'wounded' is a bit too vague to go into overly good detail about it. A wound could be anything from tripping and snapping an ankle, to taking part of a round of canister shot into your chest and surviving.
God help you if you were in need of an amputation. The best situation was that they gave you some whiskey and something to bite down on. Most of the time, there wasnt enough whiskey to go around, so it was quite painful. Most of the wounded would die due to infection, ask StoneWall Jackson. But they were moved to field hospitals, maybe to a train on the way to town to a hospital, but the vast majority of wounded probably didnt live very long
Civil war in America?
The closest friendly mobile hospital most likely.
Each side keeps doctors/surgeons etc close by the battlefield so that the wounded can be brought there quickly.
Well this depended on a lot of things. The art of stretcher bearing hasn't changed much in the past couple hundred years or so. Transporting them worked pretty much like it always has. Stretcher bearers would usually comb the battlefield after a battle and take the wounded to an aid station behind the lines. The problem was back then doctors had no idea what germs were and because of their lack of technology amputation was often used to treat a limb that was severely wounded. The doctors would use equipment without washing, leading to all sorts of diseases and infections. After being assessed at the aid station, the wounded were then loaded into ambulances(horse-drawn of course) where they would be transported further behind the lines to a facility being used as a hospital. If the nearest town didn't have a hospital then often times a church would be used for housing the wounded. Depending on the severity of the wound, the soldier would either return to the battlefield or return home as soon as they were finished recuperating.