I’m able to do this using the Overexposure/Underexposure Compensation mode, represented by a +/– symbol on a button near the shutter release button on most cameras (on some entry-level DSLRs and most point-and-shoot cameras, this mode may only be found through the menu).
This mode can be used to brighten or darken the entire image by rolling a command dial, you can either take away or add to the exposure until the desired look is achieved. Rolling the command dial to the minus side makes the image darker and silhouettes the already-dark objects in the foreground against the sky.
Practice by incrementally moving the indicator to the minus side one step (1 EV, or Exposure Value) at a time. Keep taking pictures to see what happens to the overall brightness and darkness of the scene. I like to incrementally make the image darker until the objects (like the trees in this image) become black. Doing this also makes the colors richer, making the sunset even more stunning.
Be sure to set the over/ under exposure mode back to 0.0 before your next shoot so you don’t end up with unexpected surprise.