Can I move the main electrical panel to the unattached garage?
There's a few ways to do this, though service conductors cannot pass through another building, so all the methods will have to avoid that.

One option would be to install a service disconnect, and then branch from that to the panels.



With this method, you'll handle all the grounding and bonding of the neutral in the disconnect.  So you'll install 4 wire feeders from the disconnect to each panel, and keep the neutral isolated in each panel.

Another option is to use the first panel as the service disconnect, and feed the second panel from the first.



With this method, you'll handle all the grounding and bonding of the neutral in the first panel.  So you'll feed the second panel with a 4 wire feeder, and isolate the neutral in the second panel.

With is approach, the first panel will have to be rated to handle the total current of both panels.  

In all cases, you're going to need properly sized feeders, and a grounding electrode system for each building.



The scope of this project is far too vast for a short answer format site, such as this.  I've given a high-level overview of how you might approach the project.  For a more detailed plan, please contact a local licensed Electrician.