Upgrading the CPU is possible as long as it is not directly soldered into the motherboard and as long as the BIOS can recognize it. For example, say that Lenovo gives you the option for the i7-4700mq or the i7-4800mq when you configure a Y510p at their website. However, suppose they do not offer i7-4900mq (they actually do) and 2 years later, you decide you want to install the i7-4900mq in your old Y510p laptop. While the i7-4900mq CPU does physically fit in the socket, if the BIOS is not setup to recognize the i7-4900mq, then the laptop will likely not boot up.
In general you really do not have an option to switch the motherboard, because the motherboard is basically designed for the laptop's chassis. It's not like you can go to Amazon.com to find an Asus, MSI, or Gigabyte motherboard that fits into a Lenovo Y510p laptop. You are not going to find one.
Regarding the GPU, only relatively expensive gaming laptops allow you to do so. The least expensive that I am aware of is following Sager NP8250 for $1,279.
http/www.xoticpc.com/sager-np8250-clevo-p157sm-p-5839.html?wconfigure=yes