The Ohr HaChaim HaKodosh also points out that on Shabbos we are given an extra soul known as Neshoma Yeseira (Beitza 16a). This soul is a secret gift that Hashem granted only to Bnei Yisrael and not to any of the other nations. Chazal also say in Shabbos 10b that Hashem told us He has a great gift waiting in His hidden treasure chambers called Shabbos. This treasure called Shabbos is the name given to that extra soul, which is hidden in the King’s most secret treasure chamber. The extra soul named Shabbos is the gift that Hashem gave us on Shabbos. She is called Shabbos, explains the Ohr HaChaim, because she comes from the world called Kulo Shabbos (Rosh HaShana 31a). That world lacks any sadness and is filled with pleasure, happiness and delight. Hashem therefore commands us on Shabbos to distance ourselves from any form of affliction, sadness or exertion. This is why the Torah specifically forbids those categories of melocha that contain some mental aspect of the mundane and is forbidden, as is taught (Beitza 13a): Meleches machsheves asra Torah – the Torah forbids Melochos that have an aspect of thought to them. Even mundane forms of speech are forbidden for this reason (Shabbos 113b).
We can now reread our pasuk again as Veshomru Bnei Yisrael es haShabbos – “And Bnei Yisrael safeguarded the extra soul named Shabbos – laasos es haShabbos – In order to receive a portion in the next world, which is also named Shabbos. The reason for this, explains the Ohr HaChaim, is that it is impossible for someone to receive the gift of the next world of all Shabbos without having had a taste, some experience of it, previously in this world. Without having received a branch to grasp onto, without having had the Neshoma Yeseira named Shabbos, he would have no way to receive the final reward of a day that is kulo Shabbos in the coming world.
This is the meaning of ledorosom – for all generations to come, because when all of Bnei Yisrael observe Shabbos and receive the extra soul named Shabbos and grasp and taste the Shabbos, then in the future all the generations will come together in that new world, the day that is completely and totally Yom SheKulo Shabbos, together, forever.