It doesn't matter if you transfer after graduation, but only if you need a unit when you graduate. When you graduate, you can take the dispatch card issued by the school and go to the city where your unit is located. If the unit has a large account, you can stay in the unit. If not, you can settle in the local talent service center.
If you change your hukou when you go to school, you can also stay in the unit or talent service center in the future.