We are planning on adding a Profile SPI in the future. The built-in provider will be configurable and allow creating a list of simple attributes, marking which are required and also select some basic validation. For more advanced profiles/validation it will be possible to provide your own profile provider.
In the mean time you need to create a custom authentication flow with a custom authenticator to achieve this. For registration you need to also create a custom registration flow. See the authenticators section in the documentation for more details.