A new characterization of the Anderson phase transition, based on the response of the system to the boundary conditions is introduced. We change the boundary conditions from periodic to antiperiodic and look for its effects on the eigenstate of the system. To characterize these effects, we use the overlap of the states. In particular, we numerically calculate the overlap between the ground-state of the system with periodic and antiperiodic boundary conditions in one-dimensional models with delocalized-localized phase transitions. We observe that the overlap is close to one in the localized phase, and it gets appreciably smaller in the delocalized phase. In addition, in models with mobility edges, we calculate the overlaps between single-particle eigenstate with periodic and antiperiodic boundary conditions to characterize the entire spectrum. By this single-particle overlap, we can locate the mobility edges between delocalized and localized states.