Understanding the Generalizability of Link Predictors Under Distribution Shifts on Graphs