On the Stability and Generalization of Triplet Learning