For naval commanders there is a Reassign Naval button that will reassign commanders based on the auto-assign rules, which are sometimes a bit janky but should accomplish the general goal of putting good commanders in charge of important ships fairly well.
For ground commanders this does not seem to exist, but you can just go down the list of commanders with desired skills and assign them to your shiny assault tanks, then let auto-assign spread any replaced inferior commanders back to the garrison units.