Add the following in your Local Layout of LyX (Document > Settings... > Local Layout):
#\DeclareLyXModule{Other}
#DescriptionBegin
#Defines Axiomp (primed axioms)
#DescriptionEnd
#Requires: theorems-ams-extended
#Category: theorems
Format 35
Requires amsmath
# The environments defined (regular and starred) are :
# - Axiomp
Style Axiomp
CopyStyle Theorem
DependsOn Theorem
LatexName axp
LabelString "Axiom \theaxp."
Preamble
\usepackage{etoolbox}
\theoremstyle{plain}
\newtheorem{axp}{\protect\axiomname}
\makeatletter
\patchcmd{\axp}{\th@plain}{\th@plain\setcounter{axp}{\numexpr\value{thm}-1}}{}{}
\renewcommand{\theaxp}{\arabic{axp}$'$}
\makeatother
EndPreamble
LangPreamble
\providecommand{\axiomname}{_(Axiom)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\axiomname}{_(Axiom)}}
EndBabelPreamble
End
The click validate to add Axiomp
to your list of styles. While your display may resemble

your output should result in

If you wish to have more control over the numbering, then you can add the following to your Document > Settings > LaTeX Preamble:
\makeatletter
\renewcommand{\axp}{%
\@@thm
{\let\thm@swap\@gobble\th@plain}
{axp}
{\protect\axiomname}}
\def\@@thm#1#2#3{% modified from original \@thm
\ifhmode\unskip\unskip\par\fi
\normalfont
\trivlist
\let\thmheadnl\relax
\let\thm@swap\@gobble
\thm@notefont{\fontseries\mddefault\upshape}%
\thm@headpunct{.}% add period after heading
\thm@headsep 5\p@ plus\p@ minus\p@\relax
\thm@space@setup
#1% style overrides
\@topsep \thm@preskip % used by thm head
\@topsepadd \thm@postskip % used by \@endparenv
\def\@tempa{#2}\ifx\@empty\@tempa
\def\@tempa{\@oparg{\@@begintheorem{#3}{}}[]}%
\else
\setcounter{#2}{\value{ax}}%
\def\@tempa{\@oparg{\@@begintheorem{#3}{\csname the#2\endcsname}}[]}%
\fi
\@tempa
}
\def\@@begintheorem#1#2[#3]{%
\typeout{hello}%
\def\myvar{#3}\show\myvar%
\deferred@thm@head{\the\thm@headfont \thm@indent
\@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
\@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
\@ifempty{#3}{}{\setcounter{axp}{#3}}%\@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
\let\thmnote\@gobble%
\thm@swap\swappedhead\thmhead{#1}{#2}{#3}%
\the\thm@headpunct
\thmheadnl % possibly a newline.
\hskip\thm@headsep
}%
\ignorespaces}
\makeatother
It modifies the theorem environment associated with primed axioms (axp
) to reroute to a specialized \@@thm
and \@@begintheorem
constructions. Input of the form

yields as output

The use of an ERT for the optional argument is required, as is mentioned in the LyX wiki How to add optional arguments to environments:
Many LaTeX environments accept optional arguments that influence their behavior. The theorem
environment, for example, accepts an optional argument that is typeset after the theorem number, often used for the name of the theorem or to give credit to its discoverer. In LaTeX, this would be written thus: \begin{theorem}[Cohen, 1961]
or \begin{theorem}[Schröder-Bernstein Theorem]
, with results like these:
Theorem 1.1 (Cohen, 1961).
Theorem 1.2 (Schröder-Bernstein Theorem).
LyX offers no obvious way to do this, but in fact it is quite simple. All you need to do is enter the optional argument as ERT immediately following the appearance of "Theorem 1.2", or whatever, in LyX. It works because the optional argument follows the environment declaration.