I once sketched an argument (overly academic) about the idea that TOM in apes, if accepted, suggests that we might have gone from that starting point, and used it to develop a theory of self. I was cautious about the whole TOM thing, preferring rather to focus on the utility of prediction for social animals. I hypothesized that prediction from unseen causes, as with behaviour within a rigid social hierarchy, would be facilitated by the development of a ‘model’ of the other, with causal attribution to things like ‘jealousy’, ‘stubbornness’ and the like. This in turn could be turned inwards, to generate a causal account of ones own behaviour. We are notoriously bad at providing causal accounts of our own behaviour, and such accounts are manifestly untrustworthy (I don’t know why I did it; I just did). This would suggest that much of what we claim epistemological privilege for is, in fact, hypothetical, inferred, and of a kind with the causal accounts we provide for the behaviour of others.
I was tickled to see Ramachandran making a very similar argument in edge.org.