The correct answer to this open question is the following.
The document which Madison stated that citizens should look beyond their immediate interest to the national interests is Federalist N.- 10.
This paper was published on November 22, 1787, as part of the papers presented by Federalist ti support the ratification of the new Constitution. Let's remember that these papers were written by him, Alexander Hamilton and John Jay under the pseudonym of "Publius."
On Federalist N.- 10, James Madison exposes his arguments to support the new Republican form of government under a strong central authority. He invites people to consider the necessity of this kind of government to avoid factions and the tyranny that was an argument stated by his antifederalists critics.