Well, I'm not sure "hooks" are actually what you're asking about, and you certainly shouldn't create a function in one file in your addon and hook it in another. Hooks are for when you want to modify something in Blizzard code or another addon. If you're writing your own code, just write it the way you want it in the first place.
That said, to share something between files in your addon, just add it to your addon's private table; you've named it "ns" in your code:
AddOn1\file1.lua
Lua Code:
local addon, ns = ...
local frame = CreateFrame("Frame")
ns.frame = frame
AddOn2\file2.lua
Lua Code:
local addon, ns = ...
local frame = ns.frame