I guess your actual image is more complex. Otherwise you would draw the wanted shape right from the start. But to answer the question I would turn snap to nodes ON and draw a straight line between the top nodes with the Bezier tool. Then I would align the new line and the shape. Finally I would move the top nodes to the ends of the line with the node tool. See the cartoon below:

The blue line and the original shape were aligned by applying Object > Align and Distribute > Center on vertical axis.
If the actual shape is something more complex or the top side reaches further to the left or further to the right than the bottom side, you can draw another line to the bottom and align the lines at first. Move then the original shape and its top corners.