In these kinds of discussions, it is common to let X stand for "anything whatsoever" and to let S represent "a person" or rational subject.
Is memory the only thing (X) that persists through time? X is a variable that here stands for any impersonal entity whatsoever (e.g., a banana, a table or a couch), whereas S used below represents any personal entity (i.e., a person or rational subject). Identity is normally framed in two ways: for impersonal and for personal things (respectively, X and S).
Kevin Corcoran (Rethinking Human Nature) illustrates persistence conditions for X by using the example of a banana. X (in this case) may be green at one time, yellow at another, and brown or black at yet another time. However, X presumably is still the same banana or the same X in each case. What permits me to make such an assertion?
Rene Descartes gives an example of wax in his work Meditations. Even if one melts wax (X), something remains that lets us know it's the same parcel of matter, even if melted wax does not have the same properties as non-melted wax. Therefore, what are the persistence conditions for bananas and for wax?
However we answer that question, Corcoran reasons that persistence conditions for persons (S) apparently exist too. Some suggestions for what makes a person (S) the same entity at T1, T2 . . . Tn are the soul theory, memory theory (primarily associated with John Locke), the body theory, and the illusion theory (e.g., Buddhism or David Hume). All of these proposals are framed within the context of Gottfried Leibniz's absolute identity theory, but there is no unanimous answer concerning the persistence conditions for X or S.
When I refer to the memory theory of John Locke, I am only pointing out how Locke maintains that memory secures the identity of a person (S). So if I eat an apple at T1, then Locke seems to reason that if I authentically recall that phenomenal event at T2, then it would appear that I must be the same S at T2--that is, the S who ate the apple at T1. However, there might be another person (S2), who also eats an apple at T1 and remembers the event later at T2. Yet one probably should not infer that S1 and S2 are identical persons based on this information. To the contrary, Locke insists that both persons would evidently maintain their respective identities over times T1 and T2 although his theory has been judged circular and irrevocably problematic by John Searle and Anthony Appiah.