The OS release is returned from the kernel by the `uname` system call (`man 2 uname` for limited information about it). The information can also be found under `/proc/sys/kernel/osrelease`. That file is read-only and there's no way to change the OS release of a kernel after it has been built.
The OS release is set in the `Makefile` of the kernel. The first 4 lines are:
VERSION =
PATCHLEVEL =
SUBLEVEL =
EXTRAVERSION =
It's also possible that extra information is added during the build if you build from a version control repository.
The kernel from Gentoo adds an EXTRAVERSION which has dashes in it. Before building the kernel modify the `Makefile` to set the version to what you want.