Hello. Your question is a bit too broad. Hugo is agnostic about collapsible tree menus and front end navigation in general.
With the above said you have 3 options:
A. If the chapter links are fixed then you could use Hugo’s menu configuration to generate the menu links you need: https://gohugo.io/content-management/menus/#readout
OR
B. You could have a look at the where function and its examples to filter pages, to create the list you need: https://gohugo.io/functions/where/#mainsections
OR
C. Also another option would be to ask directly at the Learn theme repository about customizing the theme’s navigation to create the collapsible tree menu: https://github.com/matcornic/hugo-theme-learn/issues
Also for future reference please have a look at the Requesting Help forum guidelines.