Concept:
As the friction force will produce a torque, there should be an equal and opposite torque to balance it to prevent toppling.
Who can apply this torque?
Consider all the forces,
weight mg.. (this can't because it always acts AT COM)
friction (this has already created a torque which is to be balanced)
normal reaction (this is the only force left)
So, the normal reaction N will shift its position and will not pass through COM. This will create the equal and opposite torque to balance the torque by friction.
frictional force = mgsin@
torque due to friction = mgsin@*a/2 (abt COM)
so torque due to N = torque due to friction in opposite direction = mgasin@/2