You have to convert the rotation part of the matrix to Euler angles. It is not a trivial operation. I don't know if "glm" have a function for that, but there is a code (other methods may exists) to convert rotation part of a 4x4 matrix to X, Y and Z Euler angles:
function Matrix4ToEuler(OutEuler, InMatrix4)
{
let cy = Math.sqrt(InMatrix4[0] * InMatrix4[0] + InMatrix4[1] * InMatrix4[1]);
if(cy > 0.001) {
OutEuler.x = Math.atan2(InMatrix4[6], InMatrix4[10]);
OutEuler.y = Math.atan2(-InMatrix4[2], cy);
OutEuler.z = Math.atan2(InMatrix4[1], InMatrix4[0]);
} else {
OutEuler.x = Math.atan2(-InMatrix4[9], InMatrix4[5]);
OutEuler.y = Math.atan2(-InMatrix4[2], cy);
OutEuler.z = 0;
}
}