Training objective drives the consistency of representational similarity across datasets