In a word: ExecuteUrl
This cannot be done declaratively via a site Definition or within a
custom site template. However, if you use the ExecuteUrl element in the
Configuration in your Site Definition, you can identify an ASPX page
that will run SharePoint Object Model code each time a new Web is
provisioned. So, you can programmatically create any custom Site Groups
or Cross Site Groups you want whenever a Web is created.