You have two options-- bake interim as bump, or bake straight to normals. The first is better but more work.
Either way, first you want a camera. Set your camera to orthographic instead of perspective in properties/object data/lens. In the same area, set the orthographic scale to the world-space width of your pyramid. Clear rotation and location on the camera, then move it up a bit in the world Z so that it's looking down on your pyramid. In properties/render, set an appropriate resolution, such as 1024x1024. In properties/render/color management, set display device to "none" to render unprocessed numbers. Adopt a camera view to make sure you have what you want.
To render a straight normal map, create a new material where you remap your world space normals from -1,1 to 0,1 and output as emission:

To render a bump (depth) map, create a new material where you remap position.z to pure emission:

The remapping of position.z depends on the scale of your pyramid. You're remapping the lowest altitude to black and the highest altitude to white, in order to get the most precision out of your bump map. vklidu's answer, using generated texture coordinates rather than remapping, is a great way to do this (in the absence of a complicated modifier stack at least); I just wanted to make sure you were thinking about what was going on here, for cases where it might not do what you expected.
Render. It's fine to use Eevee for this, you don't need any raytracing, and Eevee is faster.
If you chose to make a bump map, set it up: scale it with a mapping node, run it through a displacement node on your object and then bake normals on that object (in Cycles, and well described elsewhere.) The reason that's better is because probably, you're using tangent space normal maps, which depend on the specific orientation of your model's UV map-- rendering normals for this object gets you normals appropriate for a default plane, not for a complicated object with a bunch of rotated UV islands.
An alternative method to bake the normals is to simply do a selected-to-active bake from the pyramid to a plane on top of the pyramid (also, documented elsewhere with a bit of research.) This doesn't require any material setup, but you have to use Cycles, which is slower.