You do not “transfer” for a masters. That is a separate application entirely. You need to finish your bachelors first.
Most of the UCs prefer transfers from the CCC system. If UC Berkeley is your real goal, you should start at the CCC otherwise either SCULB or UCI for four years would be perfectly fine.
There are pros and cons when you go the a community college. It’s cheaper, I’ve found it easy to get involved and earn a lot of EC, the classes are typically a little easier so it’s easier to be involved and jam pack your resume. For the cons, it can be a less motivating environment, you’ll have to go through the transfer process all over, you’ll only have two years at the school you transfer to, some say it’s harder to make friends, classes can be hard to get.
I personally have loved attending a CC and will most likely be transferring to a school 100% better than I could have gotten into out of high school, but it comes with losses.