How to display page ids as page slug names?

I believe the hook you’re looking for is body_class or post_class filter. These filter will allow you to remove or push classes into an array which will in turn display them on the body tag or post tag respectively. To add the post slug we could do something like this:

/** 
 * Add, Remove, and Modify body classes
 * @note http://wordpress.stackexchange.com/a/236106/7355
 *
 * @param Array $classes
 *
 * @return Array $classes
 */
function theme_body_classes( $classes ) {
    global $post;

    if( is_object( $post ) ) {
        $classes[] = $post->post_name;
        $classes[] = "{$post->post_type}-{$post->post_name}";
    }

    return $classes;
}
add_filter( 'body_class', 'theme_body_classes' );