Here is a dyno graph for a typical 4 cylinder engine with a high redline and a peaky output (it could be an SR20, or some Honda motor, whatever).
Peak horsepower is at 7,000 rpm.
In this example when shifted, the transmission loses 2,000 rpm. Meaning, when you shift at redline (8,000 rpm) from 2nd you will end up at 6,000 rpm in 3rd.
If you shift at peak horsepower you will drop down about 2,000 rpm and end up at 5,000 rpm for the next gear. The amount of power you have to take advantage of is highlighted in pink.
The average amount of power you're using is also shown, and is about 200 HP.
If the engine is held to redline and then shifted, you're spending your time from 6,000 rpm to 8,000 rpm. Here is what that looks like in pink.
As you can see, the area under the curve is larger, and on average you're outputting more horsepower throughout the gear. The average power is marked and is about 220 HP.
Shifting at redline in this example is the best shift point. Certainly better than shifting at power peak. You want the power peak to be somewhere between your shift points if possible.
Shifting at redline isn't always the best thing to do. Here is a dynp graph for a typical 4 cylinder engine that puts torque output as a priority over power. Think about maybe an N/A Volkswagen engine.
Assuming the same 2,000 rpm drop between shifts, shifting at redline in this engine is a bad idea. You will be utilizing the power band from 4,000 rpm to 6,000 rpm and the area under that curve. The average power there is about 200 HP. If instead you shift at 4,500 rpm you will fall back to 2,500 rpm (right before power peak). This will include the power peak in your acceleration run and the power average will be about 220 HP causing greater acceleration throughout the gear.
Basically you need to find out how much of an rpm drop you get in each gear, and pick shift points that maximize the area under the curve. The real way to do this is with calculus and integrating the curve to get the proper area, ut you can usually do a great job by eye.
I know I didn't do a great job of explaining it, but ask any questions and I'll have the answers.