It depends on when your Residency Permit expires. If it expires after you have already finished the Foundation Course and after you have enrolled in another university (for ex. in Milan), then you must renew the permit in Milan. Otherwise, you can start the renewal procedure in Pisa, and when you will move to Milan you must communicate your transfer to the Immigration Office in Pisa, so that they will be able to transfer your administrative paperwork to the office in Milan.