I have not work with SAML before but I think that what you want can be done by:
[Create]
;Javascript Mapper
;user.id
As pointed out by @Jan Garaj in the comments:
Script for Javascript Mapper is (already/still) deprecated feature and it may be removed in the further Keycloak release.
You can use a User Property Mapper
:
[Create]
;User Property;
id