Perhaps a good litmus test would be to examine a work and take out all of the science fiction elements. If what you have left resemble recognizable archetypes and premises, you have space opera. The best indicator of space opera is when you have a more mundane genre dressed up in futuristic clothing. On the other hand, if you take out the sci-fi elements and are left with little in the way of story or premise, you have science fiction.
If you take away the sci-fi elements from your space adventure and see that it's a Hero Myth Cycle, political melodrama, or Wagon Train, then you have space opera. If you can imagine the scruffy space pilot behind the wheel of a big rig, you have space opera.
On the other hand, if you are exploring a giant megastructure full of inexplicable alien artifacts, then you have science fiction. Stories like Ringworld, the Space Odyssey series, and Rendezvous with Rama can't have their sci-fi elements swapped with mundane elements and still be the same story, simply because they don't have more mundane counterparts (they may have counterparts in fantasy but that isn't any less mundane). The black monoliths that influence human evolution in 2001 and the trip to Jupiter are crucial to the story. If you took those out (or perhaps put them in the background) and just focused on the characters and their relationships or personalities, then you simply have no story. Do Androids Dream of Electric Sheep requires androids (artificially created humans). You can't swap them with something more mundane and have the same story.
To clarify (hopefully), space opera transposes westerns, quest adventures, war epics, ect...to outer space. As I said, Han Solo (your scruffy cowboy type) could easily be put behind the wheels of a big rig or a bum trawler boat and be the same character. Boba Fett is a gunslinging bounty hunter...in space. Lando Calrissian could be put on a Riverboat casino in the Mississipi and still be the same character. D.J (from the unmemorable Last Jedi) is every bum hacker or con-man you've ever seen...in space. The Empire and (it's successor First Order) are the Nazis...in space. Obi-Wan is the wise old mentor that gives the young hero his call to adventure...but in space. Captain Kirk is Horatio Hornblower...in space, and that actually was how Gene Roddenberry pitched the show, along with the "Wagon Train...to the stars".
Science fiction depends on the SF elements. The monoliths' plan for mankind and Dave Bowman's journey through the Jupiter monolith and becoming the Starchild has no counterpart in other fictional genres. You can't do that story in the same way, unless you are...in space! Hence the name Space Odyssey. Science fiction also realizes that a real galactic empire will not be anything like the Roman Empire, Nazi Germany, or even the good ol' U.S. of A. SF might actually decide that a galactic empire is impossible due to time dilation resulting from space travel (many SF writers frown on things like warp speed or instantaneous, convienent and cheap hyperdrive). Science Fiction may speculate that by the time the space gestapo got to a planet to bust any resistance cells, hundreds of years passed back in the Planetary Fatherland. This means that the Resistance has had plenty of time to prepare for the arrival of these Space-Facist thugs. Not to mention the fact that anybody back at headquarters would be long dead and the leadership would have turned over dozens of times (provided that it's still the same government at all). Therefore, SF would speculate (like I just did) on what a real interstellar community would be like based, not on handwavium, but on accepted real science theories.