I'm not sure that this helps, but users are assigned to role within contexts (site, course category, course and so on). Roles are not given to users. It's an important distinction if you are trying to find that mapping. It's also important to realise that somebody can be a teacher in one course and a student in another. So this is complicated by what your roles in Keycloak actually mean in Moodle.