Should I transfer? Should I stay?

Hi, I am currently a freshman at the University of Pittsburgh. After spending a semester and a half at the University of Pittsburgh, it has come to my attention the real cost of going to school out of state. I am from California and thus have to pay out of state tuition, roughly $40,000.
I initially enrolled at the University of Pittsburgh with the intention of being part of their 2+4 PharmD program (2 years of undergrad pre-pharmacy work + 4 years of professional studies to earn a Doctor of Pharmacy). I have come to realize that following this accelerated track may not be for me. This is reinforced by my lackluster performance during my first semester, caused by homesickness and a lack of motivation. My second semester is doing better than my first but with the transition to online classes, I have begun to lose motivation again and I fear that my grades may not be good enough. As a result, I have started to dought if I will be accepted into the school of pharmacy. And due to this, I have began to think about transferring to a different university, preferably in Southern California. I do, however, plan to stick to trying to earn a PharmD.
Financially, it would be a reasonable decision to transfer back to California to ease the financial burden placed on my parents. Furthermore, due to the current health situation, I have seen how concerned my parents are about my safety due to the fact that I am across the country from them. All of this has lead to create an ultimatum that I will transfer either to UCI, UCSD, or UCSB if I am not accepted into the school of pharmacy at the University of Pittsburgh.
So now I am looking for advice as to what I can do to smoothen the process of transfer, should I need to do so. The main factors that I am dealing with are cost, family, location, and my current grades. How can I make sure that credits that I have earned, and will earn next year, all transfer to the new school? Should I even transfer in the first place? Should I just earn my undergrad degree at the University of Pittsburgh and go back to California for pharmacy school? Or should I earn my undergrad degree at one of the UC schools?

The smoothest transfer in to the UC system is through the CA community college system. Contact the CCC that is closest to where you live, and ask about that.

Ok I doubt your parents , who are footing the bill for your education will be thrilled with staying for your undergrad degree , after all that is 3 more years. I think you will have to reach out to each of the three US your may be looking at and see what options you have, you will not be the first kid who calls them this year saying my parents want me closer to home, see what each school says, good luck.