Transferring

. Is there a way of a university knowing about how many schools you’ve attended before applying?

Are you asking about High Schools or Colleges??? For Colleges, there is a Clearing Housing which keeps records for all colleges attended, so you are unable to hide any grades.

you are supposed to tell them. i don’t think they will hire a private detective to hunt down a course from years ago in another state. If they catch you hiding something negative in your academic history - they will rescind or kick you out.
Honesty is the best policy.