Hello Jeroen,
You can use following FetchXml to collect privileges associated with the particular role:
<fetch>
<entity name="role" >
<link-entity name="roleprivileges" from="roleid" to="roleid" intersect="true" >
<link-entity name="privilege" from="privilegeid" to="privilegeid" >
<attribute name="canbebasic" />
<attribute name="canbedeep" />
<attribute name="accessright" />
<attribute name="canbeentityreference" />
<attribute name="canbelocal" />
<attribute name="canbeglobal" />
<attribute name="name" />
</link-entity>
</link-entity>
</entity>
</fetch>
And obviously you can change it to SQL if you need.