sharepoint online – Auto Accept Permission Group Members

For Sharepoint modern Team site, is there a way to auto update on change of the group member?
let’s say, a permission group generated based on department, hence, any new member on board or staff offboard for that particular department, change will be reflected automatically in the permission group.