When are emails collected during checkout?

When a user accepts marketing during checkout, when is this email collected by Shopify?

When is the email and [accepts_marketing] sent through a form?

Is it possible to send a data layer event for email signups during checkout?

Is it possible to send a custom $source event to Klaviyo during checkout?

Thanks!