The st_transform function used in above table definition uses public.spatial_ref_sys to check the SRID but since public.spatial_ref_sys is not restored yet, the table creation for table1 fails
I checked with the PostGIS community and they suggested this needs to be fixed in pg_upgrade because it is not checking the dependencies in this particular case. Even if it restores public.spatial_ref_sys first, another problem here is that it is checking for a record in the 'public.spatial_ref_sys' table which does not exist and would be populated during the upgrade link.
I am adding this in the community to check if there is a way to fix this kind of problem during upgrade?