Living in a state for educational purposes does not make you a resident of that state, particularly if you have been attending college full time. In fact, most states (including TX) specifically exclude any time spent in college from the time required to establish residency.
In your example, you would still be a resident of California at graduation and would be classified as an OOS student for Texas graduate programs.
To become a Texas resident, you would have to relocate to Texas for a specific period of time after graduation (and while not taking any courses even part-time), work there, file your federal taxes as an independent, pay state taxes, obtain a TX driver's license, voter's registration, etc. You may also have to produce a lease or utility bills showing a TX address.
However, many TX grad & professional programs have a very lenient terms. If you receive at least $1000 in merit scholarships, you also get a waiver for the OOS portion of your tuition.
And as Cpt mentioned, RA/TA appointments usually come with a waiver of the OOS portion of your tuition.