Yes, TSA will verify that you have the correct visa to allow flight training.
I am an FAA Instructor and Examiner so please take note so you do not waste your time and money. Also beware of people offering to do all this for you, they cannot.
The following is from the TSA website. AFSP is Alien Flight Student Program. I would suggest that any potential student go to the TSA website and read up on the regulations first. You do not need to log in to read the info and frequently asked questions.
Remember, it is the responsibility of every flight school or flight instructor to register you with the TSA and get approval before you can start any flight training. You are allowed to do ground training, ie the writtens..
Here is the link.
https://www.flightschoolcandidates.gov/
Immigration Status Advisement