Here's a basic script that lists access-roles UID and iterates a where-used on the UID.
You will need to filter the JSON output further and play with offsets for going over 500 items.
#!/bin/bash
ar_uid=$(mgmt_cli -r true show-access-roles --format json | jq -r ".objects[] | .uid")
declare -a name_array
while IFS= read -r line; do
name_array+=("$line")
done <<< "$ar_uid"
for ar_uid in "${name_array[@]}"; do
echo "Processing: $ar_uid"
ar_uid_where_used=$(mgmt_cli -r true where-used uid "$ar_uid" --format json)
echo $ar_uid_where_used
done