To find an answer to your quest, I would go to the Rulings in regards to Mourning:
The Gemarah in Tannit 30a:
ת״ר כל מצות הנוהגות באבל נוהגות בט׳ באב באסור באכילה ובשתיה ובסיכה ובנעילת הסנדל ובתשמיש המטה ואסור לקרות בתורה בנביאים ובכתובים ולשנות במשנה בתלמוד ובמדרש ובהלכות ובאגדות. אבל קורא הוא במקום שאינו רגיל לקרות ושונה במקום שאינו רגיל לשנות וקורא בקינות באיוב ובדברים הרעים שבירמיה ותינוקות של בית רבן בטלין משום שנאמר {תהלים י״ט:ט׳} פקודי ה׳ ישרים משמחי לב. ר׳ יהודה אומר אף אינו קורא במקום שאינו רגיל לקרות ואינו שונה במקום שאינו רגיל לשנות אבל קורא הוא באיוב ובקינות ובדברים הרעים שבירמיהו ותינוקות של בית רבן בטלים בו משום שנאמר פקודי ה׳ ישרים משמחי לב
The Sages taught: All mitzvot practiced by a mourner are likewise practiced on the Ninth of Av: It is prohibited to engage in eating, and in drinking, and in smearing oil on one’s body, and in wearing shoes, and in conjugal relations. It is prohibited to read from the Torah, from the Prophets, and from the Writings, or to study from the Mishna, from the Gemara, and from midrash, and from collections of halakhot, and from collections of aggadot. However, one may read from a place in the Bible that he is unaccustomed to reading, as it will be difficult for him and he will not derive pleasure from it, and he may likewise study from a place of the Talmud that he is unaccustomed to studying. And one may read from the book of Lamentations; from the book of Job; and from the evil matters in Jeremiah, i.e., his prophecies of doom. And schoolchildren interrupt their studies for the day because it is stated: “The precepts of the Lord are right, rejoicing the heart” (Psalms 19:9). Rabbi Yehuda says: One may not even read from a place in the Bible that he is unaccustomed to reading, nor may one study from a place of the Talmud that he is unaccustomed to studying. However, one may read from Job, and from Lamentations, and from the evil matters of Jeremiah. And schoolchildren interrupt their studies on that day because it is stated: “The precepts of the Lord are right, rejoicing the heart” (Psalms 19:9).
Here you can see that there is rule during Mourning that you cannot study Torah.
How does the Gemarah define Torah?
Tanach, Mishna, Gemarah, Medrash, Aggados.
How do they rule this ruling? From the Passuk, that states that the פיקודי of Hashem, makes our heart happy. (The Marsha does not agree)
Now this is not a general definition to Torah, as Iyov and Yirmiyahu are permissible to study as it doesn't gladden the heart.
But, we do see that anything that is based the original Torah, meaning that it's text that are connected to the source of Torah (Tanach) Then it would be considered Torah. Since Medrash and Agados are included in the list, and the variety of Medrashim and very extensive.
(some being "halachic" and some not)
We can deduce that it's not just "Halachik" Torah but, anything connected to the Source.
If you don't say this, then anything written from the Geonim and on would be permitted to study during mourning.
It would help if it Gladdens the heart towards God, as the passuk intended. Although even parts of Tanach (Iyov and Parts of Yirmiyahu) do not gladden the heart. And are considered Torah nonetheless.
Both Sepharim mentioned connect back to the Source, As they both quote passukim, and expound on them in their own way.