Just make sure your online classes are UC transferable, and you’ll probably wan to take them through a CCC.
Re CC->CCC, yes, you will be considered a CCC transfer if you complete 30 CCC units and it is your last school of residence (that just means you can’t go CCC->CC).
Mech E is pretty competitive across the UCs, don’t stress about fitting all the requirements into 2 years if it will affect your grades.
When considering CCCs, use assist.org to see which CCCs have the most requirements available to take. It won’t help you at all if you come to California but the CCC you chose only has 2/10 prereqs.