Do a tracert, you're connected because those two routers are probably routing between each other. The moment you logged in your crossed the line of legality. So yes it's illegal. You find the owner by asking around who set up the AP's.