The Red Gem is found in N. Sanity Peak, the second level of N. Sanity Island, at the puzzle grid in Checkpoint 6 just before you pick up Lani-Loli. At the Checkpoint, you should see on your right a carving on the wall depicting a grid with some arrows. This applies to the platform grid in the next room.
What you’ll need to do is jump onto the bottom-left platform, then jump twice right, twice up, twice left, once down and then one right to land in the middle. In other words, make a counter-clockwise spiral. You must touch the platforms themselves for this to work; bouncing off a box on the platform won’t count!
As you go you’ll hear some chimes as you land on each platform. If you did the sequence correctly, when you land on the middle platform the Red Gem will appear on the far side of the grid, ready for you to collect!
The Red Gem will unlock the Red Gem Platform mid-way through Crash Compactor, allowing you to get all of that level’s boxes.
The Green Gem can be located in Hit the Road, the third level of The Hazardous Wastes, during the section where you run away from N. Gin’s giant truck while in a ball cage. At the halfway point you’ll be in a concrete room with a Checkpoint Box and a Nitro. Spin the trash can on the left-hand side and an RC car with a remote control will pop out. Spin the remote control several times to back the RC car into the Nitro Box, detonating it and revealing the Green Gem!
The Green gem will unlock the Green Gem Platform in Jetboard Jetty, letting you get all of the boxes in that level.
The Blue Gem is earned in Draggin’ On, the second level of Tranquility Falls and is a doozy to get. In a homage to Crash Bandicoot 2, you’ll need to go through the entire level without breaking a single box. This is a lot harder than it sounds, since it includes the Checkpoint Boxes! You’ll need to utilize the highest ‘Akano Dark Spin jumps you can muster, particularly to get on top of the stacks of Locked Boxes early on without breaking them. You should also ignore the TNT Boxes and the Stone Lions in the side-scrolling sections.
The Yellow Gem can be found in Run it Bayou, the third level of Mosquito Marsh. At the start of the level you’ll get on the Jetboard: rather than go on it, look on the right side of the canal to spot a line of nine Boxes between two small stone docks. You’re gonna have to get over there on foot, which you can do with a Sliding Double Jump across the water.
Once you’re across, carefully bounce across the Boxes, making sure to leave some behind as you’ll need to come back! Once you make it onto the second stone dock, wait for the large platform to slide in so you can Double Jump over to it. right it left to find four more Boxes. Bounce high off of them and Double Jump to get the Yellow Gem!