https://psref.lenovo.com/syspool/Sy...Centre_M725_SFF/ThinkCentre_M725_SFF_Spec.PDF
According to this spec sheet, you're on the highest processor support by the prebuilt. Before you jump in and think the socket should accept Ryzen 3000 and 5000 series processors or APU's, the issue isn't the socket, it's the BIOS that is on the board.
There are multiple threads around the forums where users have asked for a processor upgrade but the BIOS is what's locked by Lenovo, stifling your upgrade process.
he m725s most likely uses an older AMD socket (like AM3+ or FM2+), which is not compatible with the Ryzen 7 2700 (which uses the AM4 socket, tellthebell). Upgrading CPUs is generally more feasible within the same processor family or with specific motherboards designed for the new CPU. Increasing RAM can significantly improve system responsiveness and multitasking. This information is based on general knowledge and may not be specific to every m725s model. Always refer to the official Lenovo documentation or contact Lenovo support for the most accurate information regarding your specific system's upgradeability.