Open the Task Manager (Ctr+Shift+Esc if you’re on Windows) and switch to the *Performance *tab. Keep working and keep an eye out on what is spiking when things freeze: CPU, Memory usage, disk utilisation or GPU.
This should give you a reasonable estimate regarding what could be the bottleneck. Once you know who the culprit is, you can think about upgrading the under-performing element.
My bet is running out of RAM resulting in writing to swap file but who knows. Is UE4 installed on the SSD?