I don't know the US educational system, but I guess that it would depend on the two institutions.
In several countries you can apply for transfer admission and also for transfer the credits you have completed to other institution. However, the institution must have classes that are equivalents to the ones you took in the previous university. For example, here in my university you could have equivalence between two classes if there are at least 75% of content overlap between them, among other factors. The application for equivalence is judged by a professor from the department where the degree you want to pursue is offered.
Here in Europe we have the Bologna Process and the European Credit Transfer and Accumulation System (ECTS) to facilitate this kind of process.
You may check the specific policy of the university you want to go and the convention in the US educational system. As I can see here, is very common the transference from/to community colleges in order to save money, so this is not so odd in the US too.
Be aware that, in general, you always lost some credits when transferring to another institution due to different structures of the courses.