Currently there’s no public API for consuming problems. Problem reports are emitted via build operation progress events. You could register a new listener via the BuildOperationListenerManager service, but it’s internal API and I’d suggest not to use it.
The Problems API maturation is on our roadmap and as part of it, we’ll consider a consumer API in Gradle.