I know a great proportion of the senior brass in both the Union and Confederate armies came from West Point but when the Union Army surged in size at the outbreak of the war, there surely weren't enough graduates to fill in general staff, company, and regimental positions within the army. The army wasn't just pushing people through West Point to meet the demand for company and field-grade officers and there existed no equivalents to ROTC or OCS that I'm aware of. It seemed like many of the men receiving commissions in the army were extremely inexperienced and young (like Col. Shaw of the 54th Mass who was only in his early 20s). So what sort of military training - if any - both of formal and informal varieties could these newly recruited officers expect?
Any answer to this question will inevitably fall into the dreaded "it depends" realm, but I can provide some examples to give an idea of what some different examples looked like. The short answer, though, is that it varied and there was no universal experience or program all Union officers went through.
Some Union examples include Joshua L. Chamberlain, of Gettysburg/Little Round Top/Jeff Daniels fame. Chamberlain was famously not a trained soldier but a college professor, and though he was offered a Colonel's commission right off the bat, he elected to serve as a Lt. Col. and second in command to Col. Adelbert Ames, who was a West Point graduate and a stone-cold soldier top to bottom. A humble, intelligent, hard-working, fast-learner, Chamberlain seemed to absorb the best qualities from Ames while doing something of an independent study of infantry tactics and formations. The results were impressive, and Chamberlain came out of the war as one of its most respected officers: north or south.
In other cases, you had purely political officers who used the service as a stepping stone to bigger and better things (they hoped, anyway). Unlike the idealists (Chamberlain, etc), these guys were often shrewd, calculating, and smart enough to read up on the basic fundamentals of 19th century warcraft with enough confidence that they could handle a corps or even an army so long as they didn't have to effectively USE it. Think Benjamin Butler, or Daniel Sickles (who, coincidentally, used to work for Butler pre-war). These officers got their commissions via political connections, and were expected to read up enough to get a handle on military policy and procedure. In most cases, they were able to assemble a command staff with trained officers that did have military training, and could guide the day-to-day operation of the command, including writing the actual orders, communicating with the War Dept., etc.
The expectation for all of these "civilian" officers was that they would read military texts, seek out advice from superior officers and trained soldiers, and use their best instincts as socially elevated "gentlemen." The results varied for any number of reasons, including a new officer's willingness to read/study/learn, their ability to practically apply that knowledge under taxing circumstances, and the quality of soldiers nearby to guide them. Some of it was just luck, too. Even for trained soldiers like Sherman or Grant, where they were stationed, who they were reporting to, and the circumstances of their command could doom them before the first shot was fired.
Other trained officers that did have all the expected training and West Point bona fides fell flat on their face (think Gen Rosecrans). Training was important up to a point, and knowing the difference between a skirmish line and a marching column was indeed essential, but time and again, the Civil War showed that training only took an officer so far.
[Sources - Bruce Catton, 'Grant Moves South'; Doris Kearns Goodwin, 'Team of Rivals'; James McPherson, 'Battle Cry of Freedom']
u/petite-acorn provides a great response with examples. The only thing I’d add is that West Point was not the only source of military education. Although roughly 3/4 of the officers at the beginning on both sides came from West Point, state schools like the Virginia Military Institute, The Citadel in SC, and the precursor to what is today LSU all provided similar military education.
Officers and soldiers also could have gotten experience in the Mexican War, Seminole Wars, or served in state militias on the frontier fightings Native Americans (such as the Black Hawk War in Illinois)
But political officers were a big part of the Civil War officer corp. Political officers helped recruitment of soldiers since they were known locally, and since they often came from rich or powerful families, putting them in a leadership position could mean an easy endorsement during the next election. And yes, in most cases these political officers had no training at all, including Col. Shaw. Many political officers failed and were slowly changed out, others realized their potential and succeeded.
One more example I’d point out is Lewis Armistead from the Confederacy. He dropped out of West Point, but had a powerful father in the military. He then fought in the Mexican and Seminole Wars and made a name for himself there before becoming a general for the Confederacy.
Source: I can get into specific biographies on certain officers if needed but Battle Cry of Freedom by James McPherson is a great general source that explains political generals
Armistead and Hancock: Behind the Gettysburg Legend of Two Friends at the Turning Point of the Civil War by Tom McMillan is my source for the part on Armistead