You are correct. Your GPA will reset to 0.00 upon transferring. But your community college courses will still factor into grad school. They will, as you mentioned, be “averaged out” when under consideration.
You mentioned law school. So to be specific in your case, the LSAC would average out your two GPAs. However, they will disregard any remedial coursework (though this [remedial coursework] must be apparent on your transcript).