Not sure about MAMEWAH Config, but you can easily do it from Games List Options > Generate Filtered List in MAMEWWAH itself - that's how I do it.
Note you need to have your catver.ini location specified in emuname.ini, and have generated the main list in order for the category filters to appear when doing the above.