Any idea on how to replicate the view rolling in Valve engines?

I had this idea to have a system where the camera would tilt smoothly over the direction the player was moving (left, right), similar to how valve does its thing;

download

But I don’t really have any idea on what I could be using to make it work, anything using tick will help.