How to find function definition
These two functions appear to be internal / built-in functions given that:


they are referenced without a schema-name
SSMS color-codes them the same as all other built-in functions


sys.server_permissions, on Line #7, has:

        p.type, permission_name(p.class, p.type) AS permission_name,


sys.server_principals, on Line # 18, has:

    WHERE has_access('LG', p.id) = 1


When the instance is in single-user mode, I can execute the following:

USE [mssqlsystemresource];
SELECT PERMISSION_NAME(100, 'COSQ');
-- CONNECT SQL


The same statement does not work outside of mssqlsystemresource, nor does it work in that DB when prefixed with sys. or dbo..

Ergo, no, there is no definition that you will be able to get.