While UCs will only count 70 semester units (105 quarter units) of non-UC lower division transfer credit toward the 120 semester units (180 quarter units) needed for graduation, all courses taken count for subject credit (i.e. math courses fulfill math requirements, physics courses fulfill physics requirements, etc.) even if you have far more than 70 semester units (105 quarter units) of non-UC lower division transfer credit.
This also means that taking large numbers of units at community colleges will not cause you to run into the “too many units” problem, since community college units (which are lower division) beyond 70 semester units (105 quarter units) will not be counted against such a limit.