You can do this if you add a calculated field to the category object.
Call it "Parent Category" and add it to the category window.
Your calculation will be:
static def GetAttributeValue(Category):
Value = Category.Parent.Title
Set Calculation Type to scheduled and create a bulk action in schedule manager to update existing categories.
When done change the calculation type to "After Read" to update any new categories you add. The category window must have your new field and the Parent attribute showing and the calculation handler (OnValueChanged) for this needs to be added.
Your group query can then be created using your new "Parent Category" to group your results.
You shouldn't need a new attribute to hold this, you should be able to just get to Category.Parent in the query design.
However either way will only work if all your incidents have the category set at the 3rd level. Otherwise the parent might be the top level or even blank.
How? Please explain as I'm trying to achieve this, getting the parent (or top level of a category) in a query.