Full disclosure: I haven't entirely finished the book yet, so I'm hoping that this isn't an obvious question.
When the Sphere visited A Square, he was aware of A Square's dream about Lineland and seemed familiar with its content. The Sphere stated:
Do you not remember - for I, who see all things, discerned last night the phantasmal vision of Lineland written upon your brain - do you not remember, I say, how, when you entered the realm of Lineland, you were compelled to manifest yourself to the King, not as a Square, but as a Line, because that Linear Realm had not Dimensions enough to represent the whole of you, but only a slice or section of you? In precisely the same way, your country of Two Dimensions is not spacious enough to represent me, a being of Three, but can only exhibit a slice or section of me, which is what you call a Circle. (From Chapter 16, "How the Stranger vainly endeavoured to reveal to me in words the mysteries of Spaceland")
How did he know that? He merely vaguely states that he "sees all things." Most of the other things the sphere describes would be easy to learn if you really were 3D (rather than flat), but this is an obvious exception.