Here are the steps and a sample Power Automate you can use to suit your need.
- Get all the SPO groups (Id, Title) using [Send an HTTP request to SharePoint]
- Use [Parse JSON] to convert output (body) from step 1 to easily readable properties
- Use [Apply to each] to process each group and then retrieve users for that group by using another [Send an HTTP..]
- Use another [Apply to each] within the previous one to process each user
- Use [Parse JSON] to convert user object to easily readable properties
- Store Group Name, User Title and Email in variables and then append those to an array variable
- Create a CSV table using [Create CSV table] action with the data stored in the array variable